From d2e1efe8a38b27e67fe0331f165966f05d056695 Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Fri, 10 May 2019 11:44:38 -0700 Subject: [PATCH] src: fix warnings about redefined BSWAP macros PR-URL: https://github.com/nodejs/node/pull/27631 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig --- src/util-inl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/util-inl.h b/src/util-inl.h index 99d470205e1ce7..1abebf6e1374e8 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -27,6 +27,18 @@ #include #include "util.h" +// These are defined by or 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 #define BSWAP_2(x) _byteswap_ushort(x)