summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-20 12:29:06 (GMT)
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-20 12:29:06 (GMT)
commit2b97ab88e031327b1beaa6b169cd3ec966901067 (patch)
treec66ed88344429502f20d818b6b6b16ee2c71d60e /internal.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 'internal.h')
-rw-r--r--internal.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/internal.h b/internal.h
index 5333bca..0f16fcc 100644
--- a/internal.h
+++ b/internal.h
@@ -1325,12 +1325,11 @@ VALUE rb_fstring_new(const char *ptr, long len);
#define rb_fstring_literal(str) rb_fstring_lit(str)
VALUE rb_fstring_cstr(const char *str);
#ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-# define rb_fstring_cstr(str) __extension__ ( \
-{ \
+# define rb_fstring_cstr(str) RB_GNUC_EXTENSION_BLOCK( \
(__builtin_constant_p(str)) ? \
rb_fstring_new((str), (long)strlen(str)) : \
- rb_fstring_cstr(str); \
-})
+ rb_fstring_cstr(str) \
+)
#endif
#ifdef RUBY_ENCODING_H
VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc);
@@ -1338,12 +1337,11 @@ VALUE rb_fstring_enc_new(const char *ptr, long len, rb_encoding *enc);
#define rb_fstring_enc_literal(str, enc) rb_fstring_enc_lit(str, enc)
VALUE rb_fstring_enc_cstr(const char *ptr, rb_encoding *enc);
# ifdef HAVE_BUILTIN___BUILTIN_CONSTANT_P
-# define rb_fstring_enc_cstr(str, enc) __extension__ ( \
-{ \
+# define rb_fstring_enc_cstr(str, enc) RB_GNUC_EXTENSION_BLOCK( \
(__builtin_constant_p(str)) ? \
rb_fstring_enc_new((str), (long)strlen(str), (enc)) : \
- rb_fstring_enc_cstr(str, enc); \
-})
+ rb_fstring_enc_cstr(str, enc) \
+)
# endif
#endif
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);