summaryrefslogtreecommitdiffhomepage
path: root/include/mruby.h
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-06-09 23:27:44 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-06-09 23:27:44 +0900
commita036cbea16f5c250af830794816040d19e531377 (patch)
treecc52589e320d762e4fc8cdbc302736e6140a1538 /include/mruby.h
parentf1b1a8acd1c890f06cdd39bbbc3a85b3313a911d (diff)
parent4de468e75414eb1adb3bafba19b72caba3a17044 (diff)
downloadmruby-a036cbea16f5c250af830794816040d19e531377.tar.gz
mruby-a036cbea16f5c250af830794816040d19e531377.zip
Merge pull request #2373 from take-cheeze/static_assert
Add macro `mrb_static_assert`.
Diffstat (limited to 'include/mruby.h')
-rw-r--r--include/mruby.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 390d593bc..598ff06cf 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -429,6 +429,12 @@ void mrb_atexit(mrb_state *mrb, mrb_atexit_func func);
#define mrb_assert_int_fit(t1,n,t2,max) ((void)0)
#endif
+#if __STDC_VERSION__ >= 201112L
+#define mrb_static_assert(exp, str) _Static_assert(exp, str)
+#else
+#define mrb_static_assert(exp, str) mrb_assert(exp)
+#endif
+
mrb_value mrb_format(mrb_state *mrb, const char *format, ...);
#if defined(__cplusplus)