diff options
author | Xanadu <xanadu.xoroi@gmail.com> | 2011-03-05 00:50:00 +0100 |
---|---|---|
committer | Xanadu <xanadu.xoroi@gmail.com> | 2011-03-05 02:41:59 +0100 |
commit | c47c94f958dd11be44bad16cd5d97d9f2fea6dbf (patch) | |
tree | f4849f06a2b5bbda7036d07efde8d393ac54e620 /dep/mysqllite/include/my_compiler.h | |
parent | ed148818942fab299f344cb9c421a4df0b09fb98 (diff) |
Dep/MySQL: Updated MySQL sources to version 5.5.9 (current GA)
Diffstat (limited to 'dep/mysqllite/include/my_compiler.h')
-rw-r--r-- | dep/mysqllite/include/my_compiler.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/dep/mysqllite/include/my_compiler.h b/dep/mysqllite/include/my_compiler.h index 1cd46ff4260..5f898621159 100644 --- a/dep/mysqllite/include/my_compiler.h +++ b/dep/mysqllite/include/my_compiler.h @@ -32,8 +32,15 @@ /* GNU C/C++ */ #if defined __GNUC__ +/* Convenience macro to test the minimum required GCC version. */ +# define MY_GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) /* Any after 2.95... */ # define MY_ALIGN_EXT +/* Comunicate to the compiler the unreachability of the code. */ +# if MY_GNUC_PREREQ(4,5) +# define MY_ASSERT_UNREACHABLE() __builtin_unreachable() +# endif /* Microsoft Visual C++ */ #elif defined _MSC_VER @@ -67,8 +74,13 @@ #endif /** - Generic compiler-dependent features. + Generic (compiler-independent) features. */ + +#ifndef MY_GNUC_PREREQ +# define MY_GNUC_PREREQ(maj, min) (0) +#endif + #ifndef MY_ALIGNOF # ifdef __cplusplus template<typename type> struct my_alignof_helper { char m1; type m2; }; @@ -79,6 +91,10 @@ # endif #endif +#ifndef MY_ASSERT_UNREACHABLE +# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) +#endif + /** C++ Type Traits */ |