mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Moved the definition of rb_define_method_if_constexpr
Inside the block where `RB_METHOD_DEFINITION_DECL` family are defined.
This commit is contained in:
parent
23fbee0311
commit
661e07c97e
2 changed files with 4 additions and 1 deletions
|
@ -1052,6 +1052,10 @@ extern "C++" {
|
||||||
}
|
}
|
||||||
#endif
|
#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__
|
#define RB_UNWRAP_MACRO(...) __VA_ARGS__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -2703,7 +2703,6 @@ RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *nam
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define rb_define_method(m, n, f, a) rb_define_method_tmpl<a>::define(m, n, f)
|
#define rb_define_method(m, n, f, a) rb_define_method_tmpl<a>::define(m, n, f)
|
||||||
#else
|
#else
|
||||||
#define rb_define_method_if_constexpr(x, t, f) __builtin_choose_expr(__builtin_choose_expr(__builtin_constant_p(x),(x),0),(t),(f))
|
|
||||||
#define rb_define_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_method15,rb_define_methodm3)
|
#define rb_define_method_choose_prototype15(n) rb_define_method_if_constexpr((n)==15,rb_define_method15,rb_define_methodm3)
|
||||||
#define rb_define_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_method14,rb_define_method_choose_prototype15(n))
|
#define rb_define_method_choose_prototype14(n) rb_define_method_if_constexpr((n)==14,rb_define_method14,rb_define_method_choose_prototype15(n))
|
||||||
#define rb_define_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_method13,rb_define_method_choose_prototype14(n))
|
#define rb_define_method_choose_prototype13(n) rb_define_method_if_constexpr((n)==13,rb_define_method13,rb_define_method_choose_prototype14(n))
|
||||||
|
|
Loading…
Reference in a new issue