Skip to content

Commit

Permalink
src: fix warnings about redefined BSWAP macros
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
sam-github committed May 13, 2019
1 parent 1df3080 commit c9bdc49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/util-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c9bdc49

Please sign in to comment.