diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-05-10 11:44:38 -0700 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-05-13 13:43:07 -0700 |
commit | c9bdc49e01a67d16caf48763c42823046b37a786 (patch) | |
tree | 7424df19c65d305465022cbee8bebdf74f6c2f03 /src | |
parent | 1df3080af393a338df4cfbb56b442fe4b8345495 (diff) | |
download | android-node-v8-c9bdc49e01a67d16caf48763c42823046b37a786.tar.gz android-node-v8-c9bdc49e01a67d16caf48763c42823046b37a786.tar.bz2 android-node-v8-c9bdc49e01a67d16caf48763c42823046b37a786.zip |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/util-inl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util-inl.h b/src/util-inl.h index 99d470205e..1abebf6e13 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -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) |