diff --git a/configure.ac b/configure.ac index 1ab36e8d0f..65494b4917 100644 --- a/configure.ac +++ b/configure.ac @@ -1376,78 +1376,6 @@ RUBY_REPLACE_TYPE(clockid_t, [], CLOCKID, [@%:@ifdef HAVE_TIME_H @%:@ include @%:@endif]) -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);], - rb_cv_tokenpaste=ansi, - rb_cv_tokenpaste=knr)]) -AS_IF([test "$rb_cv_tokenpaste" = ansi], [ - AC_DEFINE(TOKEN_PASTE(x,y),[x@%:@@%:@y]) -], [ - AC_DEFINE(TOKEN_PASTE(x,y),[x/**/y]) -]) - -AC_CACHE_CHECK(stringization, rb_cv_stringization, [ - rb_cv_stringization=no - for string in "#expr" '"expr"'; do - AC_COMPILE_IFELSE([ - AC_LANG_BOOL_COMPILE_TRY([ -#define STRINGIZE0(expr) $string -#define STRINGIZE(expr) STRINGIZE0(expr) -#undef real_test_for_stringization -#define test_for_stringization -.real_test_for_stringization.- -const char stringized[[]] = STRINGIZE(test_for_stringization); -], [sizeof(stringized) == 32])], - [rb_cv_stringization="$string"; break], - [rb_cv_stringization=no]) - done] -) -AC_DEFINE(STRINGIZE(expr),STRINGIZE0(expr)) -AS_IF([test x"$rb_cv_stringization" != xno -a "$rb_cv_stringization" != "#expr"], [ - AC_DEFINE_UNQUOTED(STRINGIZE0(expr),$rb_cv_stringization) - AC_DEFINE(OLD_FASHIONED_STRINGIZATION,1) -]) - -AC_CACHE_CHECK([string literal concatenation], - rb_cv_string_literal_concatenation, [ - AC_COMPILE_IFELSE([ - AC_LANG_BOOL_COMPILE_TRY([ -const char concatenated_literal[[]] = "literals" "to" - "be" "concatenated."; -], [sizeof(concatenated_literal) == 26])], - [rb_cv_string_literal_concatenation=yes], - [rb_cv_string_literal_concatenation=no])] -) -AS_IF([test "$rb_cv_string_literal_concatenation" = no], [ - AC_MSG_ERROR([No string literal concatenation]) -]) - -AC_CACHE_CHECK(for variable length prototypes and stdarg.h, rb_cv_stdarg, - [AC_TRY_COMPILE([ -#include -int foo(int x, ...) { - va_list va; - va_start(va, x); - va_arg(va, int); - va_arg(va, char *); - va_arg(va, double); - return 0; -} -], [return foo(10, "", 3.14);], - rb_cv_stdarg=yes, - rb_cv_stdarg=no)]) -AS_IF([test "$rb_cv_stdarg" = yes], [ - AC_DEFINE(HAVE_STDARG_PROTOTYPES) -]) - # __VA_ARGS__ is also tested in AC_PROG_CC_C99 since autoconf 2.60a (around # 2006). The check below is redundant and should always success. Remain not # deleted for backward compat. diff --git a/include/ruby/internal/config.h b/include/ruby/internal/config.h index 4a7a461b7a..67d7e0156f 100644 --- a/include/ruby/internal/config.h +++ b/include/ruby/internal/config.h @@ -28,18 +28,21 @@ #include "ruby/internal/compiler_since.h" +#undef HAVE_PROTOTYPES +#define HAVE_PROTOTYPES 1 + +#undef HAVE_STDARG_PROTOTYPES +#define HAVE_STDARG_PROTOTYPES 1 + +#undef TOKEN_PASTE +#define TOKEN_PASTE(x,y) x##y + #if defined(__cplusplus) #/* __builtin_choose_expr and __builtin_types_compatible aren't available # * on C++. See https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ # undef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P # undef HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P -# undef HAVE_PROTOTYPES -# define HAVE_PROTOTYPES 1 - -# undef HAVE_STDARG_PROTOTYPES -# define HAVE_STDARG_PROTOTYPES 1 - /* HAVE_VA_ARGS_MACRO is for C. C++ situations might be different. */ # undef HAVE_VA_ARGS_MACRO # if __cplusplus >= 201103L diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 9686d1caaa..71565f0b71 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -680,9 +680,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) >= 1800 #define HAVE_VA_COPY 1 !else