From fac0c4c5c0336c161c88a300be846fcf0fe155bf Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 14 Jul 2019 02:08:14 +0300 Subject: [PATCH] mdbx-test: portability - define bswap() macros conditionally. Change-Id: I44d7daf71bd4dd66f8821af926f0c26578624e92 --- test/utils.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/utils.h b/test/utils.h index efda8394..82d6c25b 100644 --- a/test/utils.h +++ b/test/utils.h @@ -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