summaryrefslogtreecommitdiff
path: root/include/ruby/defines.h
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-20 12:29:06 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-20 12:29:06 +0000
commit2b97ab88e031327b1beaa6b169cd3ec966901067 (patch)
treec66ed88344429502f20d818b6b6b16ee2c71d60e /include/ruby/defines.h
parent27c13f82b9312f984789bb5a0426328272b3b873 (diff)
Use RB_GNUC_EXTENSION_BLOCK instead of __extension__
* include/ruby/defines.h (RB_GNUC_EXTENSION, RB_GNUC_EXTENSION_BLOCK): macros for skipping __extension__ on non-GCC compilers. * eval_error.c (warn_print): use RB_GNUC_EXTENSION_BLOCK instead of __extension__ because __extension__ is a GNU extension. Fix compile error on Solaris 10 with Oracle Solaris Studio 12.x. [Bug #12397] [ruby-dev:49629]. * internal.h (rb_fstring_cstr, rb_fstring_enc_cstr): ditto * include/ruby/encoding.h (rb_enc_str_new, rb_enc_str_new_cstr): ditto * include/ruby/intern.h (rb_str_new, rb_str_new_cstr, rb_usascii_str_new, rb_utf8_str_new, rb_tainted_str_new_cstr, rb_usascii_str_new_cstr, rb_utf8_str_new_cstr, rb_external_str_new_cstr, rb_locale_str_new_cstr, rb_str_buf_new_cstr, rb_str_cat_cstr, rb_exc_new_cstr): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/defines.h')
-rw-r--r--include/ruby/defines.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 993caf0479..49127e0106 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -71,6 +71,14 @@ extern "C" {
#define PRINTF_ARGS(decl, string_index, first_to_check) decl
#endif
+#ifdef __GNUC__
+#define RB_GNUC_EXTENSION __extension__
+#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
+#else
+#define RB_GNUC_EXTENSION
+#define RB_GNUC_EXTENSION_BLOCK(x) (x)
+#endif
+
/* AC_INCLUDES_DEFAULT */
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H