From 4a27dd0e8a6ca46a2b1f6d84b003605327ddb843 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Sun, 8 Jun 2014 23:04:22 +0900 Subject: Use `_Static_assert` when C11 is available and use it in pointer size check. --- include/mruby.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/mruby.h b/include/mruby.h index 390d593bc..c73f7c630 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) typedef char mrb_static_assert ## __LINE__[exp] +#endif + mrb_value mrb_format(mrb_state *mrb, const char *format, ...); #if defined(__cplusplus) -- cgit v1.2.3