Skip to content

Commit d2e1efe

Browse files
sam-githubtargos
authored andcommitted
src: fix warnings about redefined BSWAP macros
PR-URL: #27631 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 1365683 commit d2e1efe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/util-inl.h

+12
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@
2727
#include <cstring>
2828
#include "util.h"
2929

30+
// These are defined by <sys/byteorder.h> or <netinet/in.h> on some systems.
31+
// To avoid warnings, undefine them before redefining them.
32+
#ifdef BSWAP_2
33+
# undef BSWAP_2
34+
#endif
35+
#ifdef BSWAP_4
36+
# undef BSWAP_4
37+
#endif
38+
#ifdef BSWAP_8
39+
# undef BSWAP_8
40+
#endif
41+
3042
#if defined(_MSC_VER)
3143
#include <intrin.h>
3244
#define BSWAP_2(x) _byteswap_ushort(x)

0 commit comments

Comments
 (0)