1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Only use <nowiki>__builtin_bswap16()</nowiki> with GCC 4.8 and later.

FossilOrigin-Name: ce8177e3e64d2ac4cd5d9e7757cdd5fcecd7d0ea
This commit is contained in:
drh
2015-06-30 14:01:20 +00:00
parent 329428e208
commit ad265296ff
4 changed files with 16 additions and 9 deletions

View File

@@ -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])