mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Make mrb_static_assert() a variable argument
`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
This commit is contained in:
@@ -54,7 +54,7 @@ union mrb_value_ {
|
||||
mrb_value value;
|
||||
};
|
||||
|
||||
mrb_static_assert1(sizeof(mrb_value) == sizeof(union mrb_value_));
|
||||
mrb_static_assert(sizeof(mrb_value) == sizeof(union mrb_value_));
|
||||
|
||||
static inline union mrb_value_
|
||||
mrb_val_union(mrb_value v)
|
||||
|
||||
@@ -130,7 +130,7 @@ union mrb_value_ {
|
||||
mrb_value value;
|
||||
};
|
||||
|
||||
mrb_static_assert1(sizeof(mrb_value) == sizeof(union mrb_value_));
|
||||
mrb_static_assert(sizeof(mrb_value) == sizeof(union mrb_value_));
|
||||
|
||||
static inline union mrb_value_
|
||||
mrb_val_union(mrb_value v)
|
||||
|
||||
Reference in New Issue
Block a user