ruby-changes:40103
From: nobu <ko1@a...>
Date: Sun, 18 Oct 2015 14:53:32 +0900 (JST)
Subject: [ruby-changes:40103] nobu:r52184 (trunk): disable warnings unless optimized
nobu 2015-10-18 14:53:26 +0900 (Sun, 18 Oct 2015) New Revision: 52184 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52184 Log: disable warnings unless optimized * include/ruby/ruby.h (rb_data_object_{wrap,get,make}): warn only if optimized, as __builtin_choose_expr() does not work fine unless optimized. Modified files: trunk/include/ruby/ruby.h Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 52183) +++ include/ruby/ruby.h (revision 52184) @@ -1369,6 +1369,7 @@ RUBY_UNTYPED_DATA_FUNC(static inline VAL https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1369 #endif RUBY_UNTYPED_DATA_FUNC(static inline void *rb_data_object_get_warning(VALUE)); +#if defined(__GNUC__) && !defined(__NO_INLINE__) static inline VALUE rb_data_object_wrap_warning(VALUE klass, void *ptr, RUBY_DATA_FUNC mark, RUBY_DATA_FUNC free) { @@ -1383,6 +1384,7 @@ rb_data_object_wrap_warning(VALUE klass, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1384 rb_data_object_wrap(klass, ptr, mark, free), \ rb_data_object_wrap_warning(klass, ptr, mark, free))) #endif +#endif static inline void * rb_data_object_get(VALUE obj) @@ -1391,11 +1393,13 @@ rb_data_object_get(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1393 return ((struct RData *)obj)->data; } +#if defined(__GNUC__) && !defined(__NO_INLINE__) static inline void * rb_data_object_get_warning(VALUE obj) { return rb_data_object_get(obj); } +#endif static inline VALUE rb_data_object_make(VALUE klass, RUBY_DATA_FUNC mark_func, RUBY_DATA_FUNC free_func, void **datap, size_t size) @@ -1429,6 +1433,7 @@ rb_data_typed_object_alloc(VALUE klass, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1433 } #endif +#if defined(__GNUC__) && !defined(__NO_INLINE__) #define rb_data_object_wrap_0 rb_data_object_wrap #define rb_data_object_wrap_1 rb_data_object_wrap_warning #define rb_data_object_wrap RUBY_MACRO_SELECT(rb_data_object_wrap_, RUBY_UNTYPED_DATA_WARNING) @@ -1438,6 +1443,7 @@ rb_data_typed_object_alloc(VALUE klass, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1443 #define rb_data_object_make_0 rb_data_object_make #define rb_data_object_make_1 rb_data_object_make_warning #define rb_data_object_make RUBY_MACRO_SELECT(rb_data_object_make_, RUBY_UNTYPED_DATA_WARNING) +#endif #if USE_RGENGC #define RB_OBJ_PROMOTED_RAW(x) RB_FL_ALL_RAW(x, RUBY_FL_PROMOTED) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/