Skip to content

Commit abae640

Browse files
authored
use swap{16,32,64} from <endian.h> on OpenBSD (#71)
1 parent 0073d6a commit abae640

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/util.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919
#define bswap_64(x) OSSwapInt64(x)
2020
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
2121
# if defined(__OpenBSD__)
22-
# include <machine/endian.h>
22+
# include <endian.h>
23+
# define bswap_16(x) swap16(x)
24+
# define bswap_32(x) swap32(x)
25+
# define bswap_64(x) swap64(x)
2326
# else
2427
# include <sys/endian.h>
28+
# define bswap_16(x) bswap16(x)
29+
# define bswap_32(x) bswap32(x)
30+
# define bswap_64(x) bswap64(x)
2531
# endif
26-
#define bswap_16(x) bswap16(x)
27-
#define bswap_32(x) bswap32(x)
28-
#define bswap_64(x) bswap64(x)
2932
#else
3033
#include <byteswap.h>
3134
#endif

0 commit comments

Comments
 (0)