diff options
Diffstat (limited to 'include/my_global.h')
-rw-r--r-- | include/my_global.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h index a7ec41068b3..2434208e23f 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -192,6 +192,8 @@ #endif #undef inline_test_2 #undef inline_test_1 +/* helper macro for "instantiating" inline functions */ +#define STATIC_INLINE static inline /* The following macros are used to control inlining a bit more than @@ -426,6 +428,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 @@ -970,6 +980,14 @@ typedef unsigned __int64 my_ulonglong; typedef unsigned long long my_ulonglong; #endif +#if SIZEOF_CHARP == SIZEOF_INT +typedef int intptr; +#elif SIZEOF_CHARP == SIZEOF_LONG +typedef long intptr; +#else +#error +#endif + #ifdef USE_RAID /* The following is done with a if to not get problems with pre-processors @@ -1465,4 +1483,12 @@ do { doubleget_union _tmp; \ #define dlerror() "" #endif +/* + Only Linux is known to need an explicit sync of the directory to make sure a + file creation/deletion/renaming in(from,to) this directory durable. +*/ +#ifdef TARGET_OS_LINUX +#define NEED_EXPLICIT_SYNC_DIR 1 +#endif + #endif /* my_global_h */ |