File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -299,16 +299,18 @@ RBIMPL_WARNING_IGNORED(-Wgnu-zero-variadic-macro-arguments)
299
299
*/
300
300
#if RUBY_DEBUG
301
301
# define RBIMPL_ASSERT_OR_ASSUME RUBY_ASSERT_ALWAYS
302
+ #elif ! defined(RBIMPL_VA_OPT_ARGS)
303
+ # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSUME(expr)
302
304
#elif RBIMPL_COMPILER_BEFORE(Clang, 7, 0, 0)
303
305
# /* See commit 67d259c5dccd31fe49d417fec169977712ffdf10 */
304
- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
306
+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
305
307
#elif defined(RUBY_ASSERT_NOASSUME)
306
308
# /* See commit d300a734414ef6de7e8eb563b7cc4389c455ed08 */
307
- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
309
+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
308
310
#elif ! defined(RBIMPL_HAVE___ASSUME)
309
- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
311
+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
310
312
#else
311
- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSUME(expr)
313
+ # define RBIMPL_ASSERT_OR_ASSUME (expr, ... ) RBIMPL_ASSUME(expr)
312
314
#endif
313
315
314
316
#endif /* RUBY_ASSERT_H */
Original file line number Diff line number Diff line change 96
96
#define RB_TYPE_P RB_TYPE_P
97
97
#define Check_Type Check_Type
98
98
99
- #define RBIMPL_ASSERT_TYPE (v, t ) RBIMPL_ASSERT_OR_ASSUME(RB_TYPE_P((v), (t)))
99
+ #ifdef RBIMPL_VA_OPT_ARGS
100
+ # define RBIMPL_ASSERT_TYPE (v, t ) \
101
+ RBIMPL_ASSERT_OR_ASSUME (RB_TYPE_P(v, t), "actual type: %d", rb_type(v))
102
+ #else
103
+ # define RBIMPL_ASSERT_TYPE (v, t ) RBIMPL_ASSERT_OR_ASSUME(RB_TYPE_P(v, t))
104
+ #endif
100
105
/* * @endcond */
101
106
102
107
/* * @old{rb_type} */
You can’t perform that action at this time.
0 commit comments