aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-04-13 16:29:15 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-09-09 16:32:29 +0900
commit5a21e04dcb627667ff581d13e443249fa8d102b1 (patch)
tree67679558df639ba1fb89e9caac94ac030b917f47
parent440876c629651d32c12551abb0f157aebe996546 (diff)
downloadruby-5a21e04dcb627667ff581d13e443249fa8d102b1.tar.gz
configure.in: don't check for support for ANSI prototype decl
Our minimum is already C89.
-rw-r--r--configure.in8
-rw-r--r--dln.h10
-rw-r--r--ext/digest/sha2/sha2.h6
-rw-r--r--ext/socket/addrinfo.h22
-rw-r--r--ext/socket/getaddrinfo.c11
-rw-r--r--include/ruby/defines.h13
-rw-r--r--include/ruby/util.h21
-rw-r--r--win32/Makefile.sub1
8 files changed, 18 insertions, 74 deletions
diff --git a/configure.in b/configure.in
index c6917e7977..4180a18ea5 100644
--- a/configure.in
+++ b/configure.in
@@ -1770,14 +1770,6 @@ RUBY_REPLACE_TYPE(rlim_t, [int long "long long"], RLIM, [
RUBY_REPLACE_TYPE(off_t, [], OFFT)
RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID)
-AC_CACHE_CHECK(for prototypes, rb_cv_have_prototypes,
- [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
- rb_cv_have_prototypes=yes,
- rb_cv_have_prototypes=no)])
-AS_IF([test "$rb_cv_have_prototypes" = yes], [
- AC_DEFINE(HAVE_PROTOTYPES)
-])
-
AC_CACHE_CHECK(token paste string, rb_cv_tokenpaste,
[AC_TRY_COMPILE([@%:@define paste(a,b) a@%:@@%:@b],
[int xy = 1; return paste(x,y);],
diff --git a/dln.h b/dln.h
index d98b2607e2..f1525efeb2 100644
--- a/dln.h
+++ b/dln.h
@@ -13,21 +13,11 @@
#define DLN_H
#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
# ifndef HAVE_STDARG_PROTOTYPES
# define HAVE_STDARG_PROTOTYPES 1
# endif
#endif
-#undef _
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-
RUBY_SYMBOL_EXPORT_BEGIN
#ifndef DLN_FIND_EXTRA_ARG
diff --git a/ext/digest/sha2/sha2.h b/ext/digest/sha2/sha2.h
index e58f15ae12..9dbda9c6fd 100644
--- a/ext/digest/sha2/sha2.h
+++ b/ext/digest/sha2/sha2.h
@@ -50,11 +50,7 @@ extern "C" {
#include <sys/types.h>
#ifdef RUBY
-# ifdef HAVE_PROTOTYPES
-# undef NOPROTO
-# else
-# define NOPROTO
-# endif /* HAVE_PROTOTYPES */
+# undef NOPROTO
# ifndef BYTE_ORDER
# define LITTLE_ENDIAN 1234
# define BIG_ENDIAN 4321
diff --git a/ext/socket/addrinfo.h b/ext/socket/addrinfo.h
index f0b977d79c..8601d99a77 100644
--- a/ext/socket/addrinfo.h
+++ b/ext/socket/addrinfo.h
@@ -61,14 +61,6 @@
#undef NI_NUMERICSERV
#undef NI_DGRAM
-#ifndef __P
-# ifdef HAVE_PROTOTYPES
-# define __P(args) args
-# else
-# define __P(args) ()
-# endif
-#endif
-
/* special compatibility hack -- end*/
@@ -157,27 +149,27 @@ struct addrinfo {
#define freeaddrinfo freeaddrinfo__compat
#endif
-extern int getaddrinfo __P((
+extern int getaddrinfo(
const char *hostname, const char *servname,
const struct addrinfo *hints,
- struct addrinfo **res));
+ struct addrinfo **res);
-extern int getnameinfo __P((
+extern int getnameinfo(
const struct sockaddr *sa,
socklen_t salen,
char *host,
socklen_t hostlen,
char *serv,
socklen_t servlen,
- int flags));
+ int flags);
-extern void freehostent __P((struct hostent *));
-extern void freeaddrinfo __P((struct addrinfo *));
+extern void freehostent(struct hostent *);
+extern void freeaddrinfo(struct addrinfo *);
extern
#ifdef GAI_STRERROR_CONST
const
#endif
-char *gai_strerror __P((int));
+char *gai_strerror(int);
/* In case there is no definition of offsetof() provided - though any proper
Standard C system should have one. */
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index b01f1cb82e..af8391a9f7 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -142,12 +142,11 @@ static const struct afd {
#define PTON_MAX 4
#endif
-static int get_name __P((const char *, const struct afd *,
- struct addrinfo **, char *, struct addrinfo *,
- int));
-static int get_addr __P((const char *, int, struct addrinfo **,
- struct addrinfo *, int));
-static int str_isnumber __P((const char *));
+static int get_name(const char *, const struct afd *, struct addrinfo **,
+ char *, struct addrinfo *, int);
+static int get_addr(const char *, int, struct addrinfo **, struct addrinfo *,
+ int);
+static int str_isnumber(const char *);
static const char *const ai_errlist[] = {
"success.",
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index a4da7ea014..8474179515 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -145,20 +145,17 @@ extern "C" {
#define RUBY
#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
# ifndef HAVE_STDARG_PROTOTYPES
# define HAVE_STDARG_PROTOTYPES 1
# endif
#endif
-#undef _
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
+/* No longer used since 2.5; kept for backwards compatibility */
+#ifndef HAVE_PROTOTYPES
+# define HAVE_PROTOTYPES 1
#endif
+#undef _
+#define _(args) args
#undef __
#ifdef HAVE_STDARG_PROTOTYPES
diff --git a/include/ruby/util.h b/include/ruby/util.h
index 3b78e467b4..db2bc3e32d 100644
--- a/include/ruby/util.h
+++ b/include/ruby/util.h
@@ -24,27 +24,6 @@ extern "C" {
#include RUBY_EXTCONF_H
#endif
-#ifndef _
-#ifdef __cplusplus
-# ifndef HAVE_PROTOTYPES
-# define HAVE_PROTOTYPES 1
-# endif
-# ifndef HAVE_STDARG_PROTOTYPES
-# define HAVE_STDARG_PROTOTYPES 1
-# endif
-#endif
-#ifdef HAVE_PROTOTYPES
-# define _(args) args
-#else
-# define _(args) ()
-#endif
-#ifdef HAVE_STDARG_PROTOTYPES
-# define __(args) args
-#else
-# define __(args) ()
-#endif
-#endif
-
RUBY_SYMBOL_EXPORT_BEGIN
#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 3a9e54460c..bb0a91c6e7 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -604,7 +604,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
!if $(MSC_VER) < 1400
#define SIZE_MAX UINT_MAX
!endif
-#define HAVE_PROTOTYPES 1
#define TOKEN_PASTE(x,y) x##y
#define HAVE_STDARG_PROTOTYPES 1
!if $(MSC_VER) > 1100