Skip to content

Commit

Permalink
degzip: Fix compilation on macOS
Browse files Browse the repository at this point in the history
From reinauer@github
  • Loading branch information
keirf committed Jan 5, 2025
1 parent d17e683 commit bb9a1d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inflate/degzip_gnu.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
#include <unistd.h>
#include <getopt.h>

#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#endif

/* __packed: Given struct should not include ABI-compliant padding. */
#define __packed __attribute__((packed))

Expand Down

0 comments on commit bb9a1d7

Please sign in to comment.