diff options
author | ngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-06 09:19:14 +0000 |
---|---|---|
committer | ngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-06 09:19:14 +0000 |
commit | 434c1dc5b57090217a0a5a3a5e382e9e0065e0c1 (patch) | |
tree | cdc8a7400c6e48c54196922ce21b9b213c9f24f4 | |
parent | a6b09ea4a95824ed7905336a60f329ae7160eec5 (diff) | |
download | ruby-434c1dc5b57090217a0a5a3a5e382e9e0065e0c1.tar.gz |
* include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr):
Suppress pointer type mismatch warnings occurred with old version
of Fujitsu C Compiler (fcc) on Solaris 10. The warnings cause
failure of TestMkmf::TestConvertible. [Bug #11644] [ruby-dev:49326]
* include/ruby/ruby.h (FIX_CONST_VALUE_PTR): macro for the above,
only effective with fcc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | include/ruby/ruby.h | 16 |
2 files changed, 21 insertions, 4 deletions
@@ -1,3 +1,12 @@ +Fri Nov 6 18:07:47 2015 Naohisa Goto <ngotogenome@gmail.com> + + * include/ruby/ruby.h (rb_array_const_ptr, rb_struct_const_ptr): + Suppress pointer type mismatch warnings occurred with old version + of Fujitsu C Compiler (fcc) on Solaris 10. The warnings cause + failure of TestMkmf::TestConvertible. [Bug #11644] [ruby-dev:49326] + * include/ruby/ruby.h (FIX_CONST_VALUE_PTR): macro for the above, + only effective with fcc. + Fri Nov 6 12:39:21 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * defs/id.def (token_ops), parse.y (parser_yylex): change DOTQ diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 6486344945..f778298d62 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2004,11 +2004,19 @@ rb_array_len(VALUE a) RARRAY_EMBED_LEN(a) : RARRAY(a)->as.heap.len; } +#if defined(__fcc__) || defined(__fcc_version) || \ + defined(__FCC__) || defined(__FCC_VERSION) +/* workaround for old version of Fujitsu C Compiler (fcc) */ +# define FIX_CONST_VALUE_PTR(x) ((const VALUE *)(x)) +#else +# define FIX_CONST_VALUE_PTR(x) (x) +#endif + static inline const VALUE * rb_array_const_ptr(VALUE a) { - return (RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? - RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr; + return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? + RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr); } static inline long @@ -2021,8 +2029,8 @@ rb_struct_len(VALUE st) static inline const VALUE * rb_struct_const_ptr(VALUE st) { - return (RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? - RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr; + return FIX_CONST_VALUE_PTR((RBASIC(st)->flags & RSTRUCT_EMBED_LEN_MASK) ? + RSTRUCT(st)->as.ary : RSTRUCT(st)->as.heap.ptr); } #if defined(EXTLIB) && defined(USE_DLN_A_OUT) |