shithub: femtolisp

Download patch

ref: a5e537ceac98fde7b3050b1d310764caad9124da
parent: 13524eb51bcdd4ee9316a00b8ad6c1e6ee490ab6
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Mar 10 12:13:25 EST 2023

sort out endianess macros

--- a/llt/dtypes.h
+++ b/llt/dtypes.h
@@ -59,20 +59,18 @@
 #  define DLLEXPORT __attribute__ ((visibility("default")))
 #endif
 
-#if defined(LINUX) || defined(OPENBSD) || defined(FREEBSD) || defined(NETBSD)
-#  include <endian.h>
-#elif defined(PLAN9)
-#  define __LITTLE_ENDIAN	1234
-#  define __BIG_ENDIAN	4321
-#  define __PDP_ENDIAN	3412
-#  define __BYTE_ORDER       __LITTLE_ENDIAN
-#  define __FLOAT_WORD_ORDER __LITTLE_ENDIAN
-#  define LITTLE_ENDIAN  __LITTLE_ENDIAN
-#  define BIG_ENDIAN     __BIG_ENDIAN
-#  define PDP_ENDIAN     __PDP_ENDIAN
-#  define BYTE_ORDER     __BYTE_ORDER
+#if defined(PLAN9)
+#  define __LITTLE_ENDIAN 1234
+#  define __BIG_ENDIAN    4321
+#  define __BYTE_ORDER    __LITTLE_ENDIAN
 #else
-#  error "unknown platform"
+#  include <endian.h>
+#endif
+
+#ifndef BYTE_ORDER
+#  define LITTLE_ENDIAN   __LITTLE_ENDIAN
+#  define BIG_ENDIAN      __BIG_ENDIAN
+#  define BYTE_ORDER      __BYTE_ORDER
 #endif
 
 #ifdef PLAN9