Skip to content

Commit

Permalink
compat: remove bswap_* check on macOS
Browse files Browse the repository at this point in the history
This was originally added in #9366 to fix the gui build, as
Protobuf would also define these macros. Now that we're no-longer
using Protobuf, remove the additional check.
  • Loading branch information
fanquake authored and xanimo committed Jul 5, 2024
1 parent 7bf617b commit 11067b4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/compat/byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@

#if defined(__APPLE__)

#if !defined(bswap_16)

// Mac OS X / Darwin features; we include a check for bswap_16 because if it is already defined, protobuf has
// defined these macros for us already; if it isn't, we do it ourselves. In either case, we get the exact same
// result regardless which path was taken
#include <libkern/OSByteOrder.h>
#define bswap_16(x) OSSwapInt16(x)
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)

#endif // !defined(bswap_16)

#else
// Non-Mac OS X / non-Darwin
// Non-MacOS / non-Darwin

#if HAVE_DECL_BSWAP_16 == 0
inline uint16_t bswap_16(uint16_t x)
Expand Down

0 comments on commit 11067b4

Please sign in to comment.