From 457ad8cd46049d2b883d4cd3e9f95f6b71e45903 Mon Sep 17 00:00:00 2001 From: Adrian Siekierka Date: Tue, 24 Nov 2026 22:19:58 +0100 Subject: [PATCH] Linux: Fix building on Alpine Linux (musl libc) on AArch64 --- Lua/usocket.c | 4 ++-- Utilities/CRC32.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Lua/usocket.c b/Lua/usocket.c index f5f282195d..4fd6d19efa 100644 --- a/Lua/usocket.c +++ b/Lua/usocket.c @@ -20,7 +20,7 @@ * Wait for readable/writable/connected socket with timeout \*-------------------------------------------------------------------------*/ #ifndef SOCKET_SELECT -#include +#include #define WAITFD_R POLLIN #define WAITFD_W POLLOUT @@ -455,4 +455,4 @@ const char *socket_gaistrerror(int err) { } } -#endif \ No newline at end of file +#endif diff --git a/Utilities/CRC32.cpp b/Utilities/CRC32.cpp index e98dc65888..5ee45f2334 100644 --- a/Utilities/CRC32.cpp +++ b/Utilities/CRC32.cpp @@ -18,7 +18,9 @@ extern const uint32_t Crc32Lookup[MaxSlice][256]; // define endianess and some integer data types #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__aarch64__) // Windows always little endian - #define __BYTE_ORDER __LITTLE_ENDIAN + #ifndef __BYTE_ORDER + #define __BYTE_ORDER __LITTLE_ENDIAN + #endif #else // defines __BYTE_ORDER as __LITTLE_ENDIAN or __BIG_ENDIAN #if defined(__APPLE__) || defined(HAVE_LIBNX) @@ -30,7 +32,7 @@ extern const uint32_t Crc32Lookup[MaxSlice][256]; #endif #endif -#if !defined(__BYTE_ORDER) +#ifndef __BYTE_ORDER //Default to little endian when the symbol is not defined #define __BYTE_ORDER __LITTLE_ENDIAN #endif @@ -695,4 +697,4 @@ const uint32_t Crc32Lookup[MaxSlice][256] = 0xF088C1A2,0x5EE05033,0x7728E4C1,0xD9407550,0x24B98D25,0x8AD11CB4,0xA319A846,0x0D7139D7, } }; -// clang-format on \ No newline at end of file +// clang-format on