mdbx-test: portability - define bswap() macros conditionally.

Change-Id: I44d7daf71bd4dd66f8821af926f0c26578624e92
This commit is contained in:
Leonid Yuriev 2019-07-14 02:08:14 +03:00
parent f37a760dda
commit fac0c4c5c0

View File

@ -26,9 +26,14 @@
#endif
#if __GNUC_PREREQ(4, 4) || defined(__clang__)
#ifndef bswap64
#define bswap64(v) __builtin_bswap64(v)
#endif
#ifndef bswap32
#define bswap32(v) __builtin_bswap32(v)
#if __GNUC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16)
#endif
#if (__GNUC_PREREQ(4, 8) || __has_builtin(__builtin_bswap16)) && \
!defined(bswap16)
#define bswap16(v) __builtin_bswap16(v)
#endif