ruby-changes:54090
From: naruse <ko1@a...>
Date: Mon, 10 Dec 2018 22:58:42 +0900 (JST)
Subject: [ruby-changes:54090] naruse:r66311 (trunk): Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293]
naruse 2018-12-10 22:58:36 +0900 (Mon, 10 Dec 2018) New Revision: 66311 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66311 Log: Define HAVE_STMT_AND_DECL_IN_EXPR and use it [Bug #15293] Modified files: trunk/configure.ac trunk/include/ruby/ruby.h Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 66310) +++ include/ruby/ruby.h (revision 66311) @@ -1818,7 +1818,7 @@ VALUE rb_check_symbol(volatile VALUE *na https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1818 do RUBY_CONST_ID_CACHE((var) =, (str)) while (0) #define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str) #define CONST_ID(var, str) RUBY_CONST_ID(var, str) -#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P +#if defined(HAVE_BUILTIN___BUILTIN_CONSTANT_P) && defined(HAVE_STMT_AND_DECL_IN_EXPR) /* __builtin_constant_p and statement expression is available * since gcc-2.7.2.3 at least. */ #define rb_intern(str) \ Index: configure.ac =================================================================== --- configure.ac (revision 66310) +++ configure.ac (revision 66311) @@ -730,6 +730,13 @@ test -z "${ac_env_CFLAGS_set}" -a -n "${ https://github.com/ruby/ruby/blob/trunk/configure.ac#L730 test -z "${ac_env_CXXFLAGS_set}" -a -n "${cxxflags+set}" && eval CXXFLAGS="\"$cxxflags $ARCH_FLAG\"" } +AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ + int main(void) { + return __extension__ ({ int a = 0; a; }); + } + ]])], + [AC_DEFINE(HAVE_STMT_AND_DECL_IN_EXPR, 1)]) + : "header and library section" && { AC_ARG_WITH(winnt-ver, AS_HELP_STRING([--with-winnt-ver=0xXXXX], [target Windows NT version (default to 0x0600)]), -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/