1
0
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:
mistachkin
2015-06-30 17:28:40 +00:00
parent da6d3e2117
commit 647ca46fc5
5 changed files with 29 additions and 11 deletions

View File

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