summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-10 12:45:21 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-10 12:45:21 (GMT)
commit50b78ebb982b9e3e3639967c27786557aa5faf14 (patch)
treedc220ded04f37b40205d93d27c315b298aedf3c8 /include
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 'include')
-rw-r--r--include/ruby/ruby.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 8171ab3..dbea8e4 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -568,7 +568,7 @@ int ruby_safe_level_4_warning(void) __attribute__((warning("$SAFE=4 is obsolete"
__extension__(__builtin_constant_p(level) && \
((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)))
#define RUBY_SAFE_LEVEL_CHECK(level, type) \
- (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4_##type() : (level))
+ __extension__(__builtin_choose_expr(RUBY_SAFE_LEVEL_INVALID_P(level), ruby_safe_level_4_##type(), (level)))
#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level, warning))
#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
#endif