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 --- src/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gc.c') diff --git a/src/gc.c b/src/gc.c index fce2c3150..a6ff0c588 100644 --- a/src/gc.c +++ b/src/gc.c @@ -200,7 +200,7 @@ gettimeofday_time(void) #define GC_RED MRB_GC_RED #define GC_WHITES (GC_WHITE_A | GC_WHITE_B) #define GC_COLOR_MASK 7 -mrb_static_assert1(MRB_GC_RED <= GC_COLOR_MASK); +mrb_static_assert(MRB_GC_RED <= GC_COLOR_MASK); #define paint_gray(o) ((o)->color = GC_GRAY) #define paint_black(o) ((o)->color = GC_BLACK) -- cgit v1.2.3