shithub: femtolisp

Download patch

ref: f5e20c5823337a159618f02c861af69879b0f0e8
parent: 305ad9c2c8c62668bd3df2133494801b99b99a67
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Thu Apr 13 13:11:16 EDT 2023

fix mpint on big endian

--- a/posix/mp.h
+++ b/posix/mp.h
@@ -14,9 +14,14 @@
 union FPdbleword
 {
 	double	x;
-	struct {	/* little endian */
+	struct {
+#if BYTE_ORDER == LITTLE_ENDIAN
 		uint lo;
 		uint hi;
+#else
+		uint hi;
+		uint lo;
+#endif
 	};
 };
 
--- a/posix/platform.h
+++ b/posix/platform.h
@@ -23,7 +23,6 @@
 #include <unistd.h>
 #include <wctype.h>
 #include <wchar.h>
-#include "mp.h"
 
 #ifndef __SIZEOF_POINTER__
 #error pointer size unknown
@@ -47,3 +46,5 @@
 #define BIG_ENDIAN __BIG_ENDIAN
 #define BYTE_ORDER __BYTE_ORDER
 #endif
+
+#include "mp.h"