From 48695a582cc427dc1b2054efcd57c0b0150370ce Mon Sep 17 00:00:00 2001 From: zsugabubus Date: Thu, 11 Sep 2025 12:47:24 +0200 Subject: [PATCH 1/6] Fix MacOS --- program.c | 3 ++- websocket.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git program.c program.c index d67bcd0..5c2e59c 100644 --- program.c +++ program.c @@ -1,4 +1,5 @@ -#include +#include +#include #include #include diff --git websocket.c websocket.c index 8d82aaf..7d5fe6d 100644 --- websocket.c +++ websocket.c @@ -1,7 +1,6 @@ #define _GNU_SOURCE #include -#include #include #include #include @@ -15,6 +14,20 @@ #include #include +#if defined(__APPLE__) + +#include +#define htobe16(x) OSSwapHostToBigInt16(x) +#define htobe64(x) OSSwapHostToBigInt64(x) +#define be16toh(x) OSSwapBigToHostInt16(x) +#define be64toh(x) OSSwapBigToHostInt64(x) + +#else + +#include + +#endif + #include "program.h" #include "websocket.h" -- 2.51.0