summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2021-09-19 20:06:17 +0200
committerMartin Schanzenbach <mschanzenbach@posteo.de>2021-09-19 20:06:17 +0200
commit83c0efff026598098addfabdf72698d5d13b7b48 (patch)
treea3508b8274a7db890198a5f0048954972522d157 /src
parentdf00745ee4eb1a322111552c2f934c13aae41454 (diff)
-BUILD: Fix bswap portability
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_common.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h
index ca3ddceaa..4472d3ee8 100644
--- a/src/include/gnunet_common.h
+++ b/src/include/gnunet_common.h
@@ -151,10 +151,10 @@ enum GNUNET_GenericReturnValue
*/
#if __BYTE_ORDER == __LITTLE_ENDIAN
-#if defined(__linux__)
-#define BYTE_SWAP_16(x) __bswap_16 (x)
-#define BYTE_SWAP_32(x) __bswap_32 (x)
-#define BYTE_SWAP_64(x) __bswap_64 (x)
+#ifdef HAVE_BYTESWAP_H
+#define BYTE_SWAP_16(x) bswap_16 (x)
+#define BYTE_SWAP_32(x) bswap_32 (x)
+#define BYTE_SWAP_64(x) bswap_64 (x)
#else
#define BYTE_SWAP_16(x) ((((x) & 0x00ff) << 8) | (((x) & 0xff00) >> 8))