mirror of
https://github.com/luanti-org/luanti.git
synced 2026-10-11 22:09:57 +00:00
Fix endian.h handling
if it exists we need to include it to get htobe16() et al
This commit is contained in:
+4
-4
@@ -70,7 +70,10 @@
|
||||
* endian.h compatibility shim
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(HAVE_ENDIAN_H)
|
||||
#include <endian.h>
|
||||
|
||||
#elif defined(_WIN32)
|
||||
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#define BIG_ENDIAN 4321
|
||||
@@ -85,9 +88,6 @@
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_ENDIAN_H)
|
||||
#include <endian.h>
|
||||
|
||||
#elif defined(__MACH__) && defined(__APPLE__)
|
||||
#include <machine/endian.h>
|
||||
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
#include <string_view>
|
||||
|
||||
/* make sure BYTE_ORDER macros are available */
|
||||
#ifdef _WIN32
|
||||
#if HAVE_ENDIAN_H
|
||||
#include <endian.h>
|
||||
#elif defined(_WIN32)
|
||||
#define BYTE_ORDER 1234
|
||||
#elif defined(__MACH__) && defined(__APPLE__)
|
||||
#include <machine/endian.h>
|
||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
#include <sys/endian.h>
|
||||
#elif HAVE_ENDIAN_H
|
||||
#include <endian.h>
|
||||
#else
|
||||
#error "Can't detect endian (missing header)"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user