summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-10 12:45:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-10 12:45:21 +0000
commit50b78ebb982b9e3e3639967c27786557aa5faf14 (patch)
treedc220ded04f37b40205d93d27c315b298aedf3c8 /thread.c
parent12088a7e95f203972c52f3b4d7d9bd8f909a20dc (diff)
ruby/ruby.h: eliminate disabled function call
* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): eliminate function call for warning/error if not match to get rid of unconditional warning/error by a certain compiler option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index aedd0c1e0e..14a4148c6f 100644
--- a/thread.c
+++ b/thread.c
@@ -145,7 +145,11 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio
} while(0)
#ifdef __GNUC__
+#ifdef HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR
+#define only_if_constant(expr, notconst) __builtin_choose_expr(__builtin_constant_p(expr), (expr), (notconst))
+#else
#define only_if_constant(expr, notconst) (__builtin_constant_p(expr) ? (expr) : (notconst))
+#endif
#else
#define only_if_constant(expr, notconst) notconst
#endif