diff options
| author | take_cheeze <[email protected]> | 2014-06-08 23:04:22 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2014-06-08 23:16:51 +0900 |
| commit | 4a27dd0e8a6ca46a2b1f6d84b003605327ddb843 (patch) | |
| tree | 87aa357409719001632bf4a308e481ccb38bf0d0 /include/mruby.h | |
| parent | e070fce835601ef9ff8d6fac8f7b16ff1a12cc54 (diff) | |
| download | mruby-4a27dd0e8a6ca46a2b1f6d84b003605327ddb843.tar.gz mruby-4a27dd0e8a6ca46a2b1f6d84b003605327ddb843.zip | |
Use `_Static_assert` when C11 is available and use it in pointer size check.
Diffstat (limited to 'include/mruby.h')
| -rw-r--r-- | include/mruby.h | 6 |
1 files changed, 6 insertions, 0 deletions
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) |
