comparison Core/Endianness.h @ 2546:6d5e36e1256f

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 19:19:27 +0200
parents 98a04e75f15e
children 0511feaf0ec2
comparison
equal deleted inserted replaced
2545:9f325c631973 2546:6d5e36e1256f
67 # define ORTHANC_HAS_BUILTIN_BYTE_SWAP 1 67 # define ORTHANC_HAS_BUILTIN_BYTE_SWAP 1
68 # define be16toh(x) __builtin_bswap16(x) 68 # define be16toh(x) __builtin_bswap16(x)
69 # define be32toh(x) __builtin_bswap32(x) 69 # define be32toh(x) __builtin_bswap32(x)
70 # define be64toh(x) __builtin_bswap64(x) 70 # define be64toh(x) __builtin_bswap64(x)
71 # else 71 # else
72 // MinGW <= 4.2, we must manually implement the byte swapping 72 // MinGW <= 4.2, we must manually implement the byte swapping (*)
73 # define ORTHANC_HAS_BUILTIN_BYTE_SWAP 0 73 # define ORTHANC_HAS_BUILTIN_BYTE_SWAP 0
74 # define be16toh(x) __orthanc_bswap16(x) 74 # define be16toh(x) __orthanc_bswap16(x)
75 # define be32toh(x) __orthanc_bswap32(x) 75 # define be32toh(x) __orthanc_bswap32(x)
76 # define be64toh(x) __orthanc_bswap64(x) 76 # define be64toh(x) __orthanc_bswap64(x)
77 # endif 77 # endif
168 static_cast<uint64_t>(p[5]) << 16 | 168 static_cast<uint64_t>(p[5]) << 16 |
169 static_cast<uint64_t>(p[6]) << 8 | 169 static_cast<uint64_t>(p[6]) << 8 |
170 static_cast<uint64_t>(p[7])); 170 static_cast<uint64_t>(p[7]));
171 } 171 }
172 172
173 #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN) 173 #if defined(_WIN32)
174 // Implemented above (*)
175 #elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
174 # if __BYTE_ORDER == __LITTLE_ENDIAN 176 # if __BYTE_ORDER == __LITTLE_ENDIAN
175 # define be16toh(x) __orthanc_bswap16(x) 177 # define be16toh(x) __orthanc_bswap16(x)
176 # define be32toh(x) __orthanc_bswap32(x) 178 # define be32toh(x) __orthanc_bswap32(x)
177 # define be64toh(x) __orthanc_bswap64(x) 179 # define be64toh(x) __orthanc_bswap64(x)
178 # define htobe16(x) __orthanc_bswap16(x) 180 # define htobe16(x) __orthanc_bswap16(x)