From b774832ee1a97c44cabbbaac004a3b784ed02a83 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 24 Oct 2021 23:11:52 +0900 Subject: Make `mrb_static_assert()` a variable argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `mrb_static_assert()` extends the macro function to take one or two arguments. If the argument is other than that, an error will occur. References: - static_assert のメッセージ省略を許可 - cpprefjp C++日本語リファレンス https://cpprefjp.github.io/lang/cpp17/extending_static_assert.html - c - Overloading Macro on Number of Arguments - Stack Overflow https://stackoverflow.com/a/11763277 --- mrbgems/mruby-random/src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrbgems/mruby-random/src') diff --git a/mrbgems/mruby-random/src/random.c b/mrbgems/mruby-random/src/random.c index 027e7ce0b..0728e6bf2 100644 --- a/mrbgems/mruby-random/src/random.c +++ b/mrbgems/mruby-random/src/random.c @@ -355,7 +355,7 @@ void mrb_mruby_random_gem_init(mrb_state *mrb) struct RClass *random; struct RClass *array = mrb->array_class; - mrb_static_assert1(sizeof(rand_state) <= ISTRUCT_DATA_SIZE); + mrb_static_assert(sizeof(rand_state) <= ISTRUCT_DATA_SIZE); mrb_define_method(mrb, mrb->kernel_module, "rand", random_f_rand, MRB_ARGS_OPT(1)); mrb_define_method(mrb, mrb->kernel_module, "srand", random_f_srand, MRB_ARGS_OPT(1)); -- cgit v1.2.3