File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -299,16 +299,18 @@ RBIMPL_WARNING_IGNORED(-Wgnu-zero-variadic-macro-arguments)
299299 */
300300#if RUBY_DEBUG
301301# 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)
302304#elif RBIMPL_COMPILER_BEFORE(Clang, 7, 0, 0)
303305# /* See commit 67d259c5dccd31fe49d417fec169977712ffdf10 */
304- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
306+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
305307#elif defined(RUBY_ASSERT_NOASSUME)
306308# /* See commit d300a734414ef6de7e8eb563b7cc4389c455ed08 */
307- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
309+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
308310#elif ! defined(RBIMPL_HAVE___ASSUME)
309- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSERT_NOTHING
311+ # define RBIMPL_ASSERT_OR_ASSUME (... ) RBIMPL_ASSERT_NOTHING
310312#else
311- # define RBIMPL_ASSERT_OR_ASSUME (expr ) RBIMPL_ASSUME(expr)
313+ # define RBIMPL_ASSERT_OR_ASSUME (expr, ... ) RBIMPL_ASSUME(expr)
312314#endif
313315
314316#endif /* RUBY_ASSERT_H */
Original file line number Diff line number Diff line change 9696#define RB_TYPE_P RB_TYPE_P
9797#define Check_Type Check_Type
9898
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
100105/* * @endcond */
101106
102107/* * @old{rb_type} */
You can’t perform that action at this time.
0 commit comments