src: fix warnings about redefined BSWAP macros
PR-URL: https://github.com/nodejs/node/pull/27631 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
1df3080af3
commit
c9bdc49e01
@ -27,6 +27,18 @@
|
||||
#include <cstring>
|
||||
#include "util.h"
|
||||
|
||||
// These are defined by <sys/byteorder.h> or <netinet/in.h> on some systems.
|
||||
// To avoid warnings, undefine them before redefining them.
|
||||
#ifdef BSWAP_2
|
||||
# undef BSWAP_2
|
||||
#endif
|
||||
#ifdef BSWAP_4
|
||||
# undef BSWAP_4
|
||||
#endif
|
||||
#ifdef BSWAP_8
|
||||
# undef BSWAP_8
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <intrin.h>
|
||||
#define BSWAP_2(x) _byteswap_ushort(x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user