diff options
Diffstat (limited to 'include/my_global.h')
-rw-r--r-- | include/my_global.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h index 8b35f995a48..c88cf4e6e4b 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -458,6 +458,14 @@ C_MODE_END */ #include <assert.h> +/* an assert that works at compile-time. only for constant expression */ +#define compile_time_assert(X) \ + do \ + { \ + char compile_time_assert[(X) ? 1 : -1] \ + __attribute__ ((unused)); \ + } while(0) + /* Go around some bugs in different OS and compilers */ #if defined (HPUX11) && defined(_LARGEFILE_SOURCE) #define _LARGEFILE64_SOURCE |