diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/btreeInt.h | 2 | ||||
-rw-r--r-- | src/sqliteInt.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/btreeInt.h b/src/btreeInt.h index 1ccdb0839..74117848a 100644 --- a/src/btreeInt.h +++ b/src/btreeInt.h @@ -699,7 +699,7 @@ struct IntegrityCk { */ #if SQLITE_BYTEORDER==4321 # define get2byteAligned(x) (*(u16*)(x)) -#elif SQLITE_BYTEORDER==1234 && defined(__GNUC__) +#elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4008000 # define get2byteAligned(x) __builtin_bswap16(*(u16*)(x)) #else # define get2byteAligned(x) ((x)[0]<<8 | (x)[1]) diff --git a/src/sqliteInt.h b/src/sqliteInt.h index aed6557cd..907434889 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -60,6 +60,13 @@ # define _LARGEFILE_SOURCE 1 #endif +/* What version of GCC is being used. 0 means GCC is not being used */ +#ifdef __GNUC__ +# define GCC_VERSION (__GNUC__*1000000+__GNUC_MINOR__*1000+__GNUC_PATCHLEVEL__) +#else +# define GCC_VERSION 0 +#endif + /* Needed for various definitions... */ #if defined(__GNUC__) && !defined(_GNU_SOURCE) # define _GNU_SOURCE |