diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-09-12 23:44:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-12 23:44:16 +0300 |
commit | a38d19a7595c3e672f5ed549400b36348e01e442 (patch) | |
tree | 34bd1c4db9b95748d263aea811e849dec7e5525c /src/ByteSwap.h | |
parent | 713b92c3c233f8f38200c4a458e0196d3d39a3b0 (diff) | |
parent | 15831dbca85dd906edbad2bfff2b147527a456e2 (diff) |
Merge PR #3644: Don't include PCH headers directly, add missing includes
Diffstat (limited to 'src/ByteSwap.h')
-rw-r--r-- | src/ByteSwap.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ByteSwap.h b/src/ByteSwap.h index 54521ef85..d570351cc 100644 --- a/src/ByteSwap.h +++ b/src/ByteSwap.h @@ -6,14 +6,17 @@ #ifndef MUMBLE_BYTESWAP_H_ #define MUMBLE_BYTESWAP_H_ +#include <QtCore/QtGlobal> + #if Q_BYTE_ORDER == Q_BIG_ENDIAN -#define SWAP64(x) (x) -#else -#if defined(__x86_64__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -#define SWAP64(x) __builtin_bswap64(x) +# define SWAP64(x) (x) #else -#define SWAP64(x) qbswap<quint64>(x) -#endif +# if defined(__x86_64__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define SWAP64(x) __builtin_bswap64(x) +# else +# include <QtCore/QtEndian> +# define SWAP64(x) qbswap<quint64>(x) +# endif #endif #endif |