From 8533ebe0adf67a8b0d5cdfe417e22bda0c0dd505 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Wed, 9 Oct 2024 18:57:22 +0700 Subject: [PATCH 05/10] libqcdm: fix endian macros --- libqcdm/src/commands.c | 8 ++++++++ libqcdm/src/logs.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/libqcdm/src/commands.c b/libqcdm/src/commands.c index cd21281c..1478a70c 100644 --- a/libqcdm/src/commands.c +++ b/libqcdm/src/commands.c @@ -17,7 +17,15 @@ #include #include +#ifdef __APPLE__ +#include +#define htole16(x) OSSwapHostToLittleInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) +#else #include +#endif #include "commands.h" #include "errors.h" diff --git a/libqcdm/src/logs.c b/libqcdm/src/logs.c index 91152c42..b9a2bb74 100644 --- a/libqcdm/src/logs.c +++ b/libqcdm/src/logs.c @@ -17,7 +17,15 @@ #include #include +#ifdef __APPLE__ +#include +#define htole16(x) OSSwapHostToLittleInt16(x) +#define le16toh(x) OSSwapLittleToHostInt16(x) +#define htole32(x) OSSwapHostToLittleInt32(x) +#define le32toh(x) OSSwapLittleToHostInt32(x) +#else #include +#endif #include "log-items.h" #include "logs.h" -- 2.46.1