mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Make use of the _byteswap_ushort() and _byteswap_ulong() compiler intrinsics for MSVC, when available.
FossilOrigin-Name: fe144dd73f7097a17c24c7812c2a1cc40466e6da
This commit is contained in:
@@ -701,6 +701,8 @@ struct IntegrityCk {
|
||||
# define get2byteAligned(x) (*(u16*)(x))
|
||||
#elif SQLITE_BYTEORDER==1234 && GCC_VERSION>=4008000
|
||||
# define get2byteAligned(x) __builtin_bswap16(*(u16*)(x))
|
||||
#elif SQLITE_BYTEORDER==1234 && defined(_MSC_VER) && _MSC_VER>=1300
|
||||
# define get2byteAligned(x) _byteswap_ushort(*(u16*)(x))
|
||||
#else
|
||||
# define get2byteAligned(x) ((x)[0]<<8 | (x)[1])
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user