Merge pull request #8642 from JoelLinn/fix-mingw-bswap

Fix MinGW compilation
This commit is contained in:
Matt Fowles Kulukundis 2021-05-22 19:56:54 -04:00 committed by GitHub
commit 998d3a343a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,14 +263,14 @@ static inline uint32 bswap_32(uint32 x) {
#ifndef bswap_64
static inline uint64 bswap_64(uint64 x) {
return (((x & uint64_t{0xFFu)) << 56) |
((x & uint64_t{0xFF00u)) << 40) |
((x & uint64_t{0xFF0000u)) << 24) |
((x & uint64_t{0xFF000000u)) << 8) |
((x & uint64_t{0xFF00000000u)) >> 8) |
((x & uint64_t{0xFF0000000000u)) >> 24) |
((x & uint64_t{0xFF000000000000u)) >> 40) |
((x & uint64_t{0xFF00000000000000u)) >> 56));
return (((x & uint64_t{0xFFu}) << 56) |
((x & uint64_t{0xFF00u}) << 40) |
((x & uint64_t{0xFF0000u}) << 24) |
((x & uint64_t{0xFF000000u}) << 8) |
((x & uint64_t{0xFF00000000u}) >> 8) |
((x & uint64_t{0xFF0000000000u}) >> 24) |
((x & uint64_t{0xFF000000000000u}) >> 40) |
((x & uint64_t{0xFF00000000000000u}) >> 56));
}
#define bswap_64(x) bswap_64(x)
#endif