diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-09 19:08:54 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-01-09 21:32:26 +0900 |
commit | 661e07c97e1cc742290d045dc5102e5fbdbae6a1 (patch) | |
tree | 9e05f167f642e1843a631dc9e6bd437642945d98 /include/ruby/intern.h | |
parent | 23fbee0311d34da4f623a828bf0c015a90d8edc9 (diff) | |
download | ruby-661e07c97e1cc742290d045dc5102e5fbdbae6a1.tar.gz |
Moved the definition of `rb_define_method_if_constexpr`
Inside the block where `RB_METHOD_DEFINITION_DECL` family are
defined.
Diffstat (limited to 'include/ruby/intern.h')
-rw-r--r-- | include/ruby/intern.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h index 2f60fb569e..7854d63764 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -1052,6 +1052,10 @@ extern "C++" { } #endif +#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) +#define rb_define_method_if_constexpr(x, t, f) __builtin_choose_expr(__builtin_choose_expr(__builtin_constant_p(x),(x),0),(t),(f)) +#endif + #define RB_UNWRAP_MACRO(...) __VA_ARGS__ #ifdef __cplusplus |