From c6df30edb96eb53fe88524759aa123d7393532b1 Mon Sep 17 00:00:00 2001
From: "Thomas G. Lockhart" <lockhart@fourpalms.org>
Date: Fri, 11 Jul 1997 14:03:01 +0000
Subject: [PATCH] Modify port-specific definitions to support missing endian
 information. Add extra include file for aix to find endian information.

---
 src/include/port/aix.h           |  1 +
 src/include/port/dgux.h          | 14 ++++++++++++--
 src/include/port/i386_solaris.h  | 13 +++++++++++--
 src/include/port/sparc_solaris.h |  9 +++++++++
 src/include/port/sunos4.h        | 15 ++++++++++++---
 src/include/port/ultrix4.h       |  9 +++++++++
 src/include/port/univel.h        |  9 +++++++++
 7 files changed, 63 insertions(+), 7 deletions(-)

diff --git a/src/include/port/aix.h b/src/include/port/aix.h
index 30b9a18493b..25d33eb87b8 100644
--- a/src/include/port/aix.h
+++ b/src/include/port/aix.h
@@ -5,3 +5,4 @@
 #  define HAVE_ANSI_CPP
 #  define HAS_TEST_AND_SET
    typedef unsigned int slock_t;
+#include <sys/machine.h>	/* ENDIAN definitions for network communication */
diff --git a/src/include/port/dgux.h b/src/include/port/dgux.h
index e99e3dbc2ca..4d95ea3160f 100644
--- a/src/include/port/dgux.h
+++ b/src/include/port/dgux.h
@@ -1,7 +1,17 @@
 #define LINUX_ELF
 #define USE_POSIX_SIGNALS
 #define USE_POSIX_TIME
-#ifndef         BYTE_ORDER
-# define         BYTE_ORDER      BIG_ENDIAN
+
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN	3412
+#endif
+#ifndef		BYTE_ORDER
+#define		BYTE_ORDER	BIG_ENDIAN
 #endif
 
diff --git a/src/include/port/i386_solaris.h b/src/include/port/i386_solaris.h
index 0ac1116f06f..c4070f1381d 100644
--- a/src/include/port/i386_solaris.h
+++ b/src/include/port/i386_solaris.h
@@ -7,8 +7,17 @@
 
 #include <sys/isa_defs.h>
 
-#ifndef         BYTE_ORDER
-#define         BYTE_ORDER      LITTLE_ENDIAN
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN      3412
+#endif
+#ifndef		BYTE_ORDER
+#define		BYTE_ORDER	LITTLE_ENDIAN
 #endif
 
 #ifndef         NAN
diff --git a/src/include/port/sparc_solaris.h b/src/include/port/sparc_solaris.h
index 25746c62669..9e7a6b7775c 100644
--- a/src/include/port/sparc_solaris.h
+++ b/src/include/port/sparc_solaris.h
@@ -5,6 +5,15 @@
 #  define HAS_TEST_AND_SET
    typedef unsigned char slock_t;
 
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN	3412
+#endif
 #ifndef		BYTE_ORDER
 #define		BYTE_ORDER	BIG_ENDIAN
 #endif
diff --git a/src/include/port/sunos4.h b/src/include/port/sunos4.h
index c1ec7f50610..d395cbdbe12 100644
--- a/src/include/port/sunos4.h
+++ b/src/include/port/sunos4.h
@@ -1,5 +1,14 @@
 #define USE_POSIX_TIME
-#ifndef               BYTE_ORDER
-#  define               BYTE_ORDER      BIG_ENDIAN
-#endif
 
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN	3412
+#endif
+#ifndef		BYTE_ORDER
+#define		BYTE_ORDER	BIG_ENDIAN
+#endif
diff --git a/src/include/port/ultrix4.h b/src/include/port/ultrix4.h
index c050965d5b0..38cce4d257f 100644
--- a/src/include/port/ultrix4.h
+++ b/src/include/port/ultrix4.h
@@ -1,6 +1,15 @@
 #  define USE_POSIX_TIME
 #  define NEED_STRDUP
 
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN	3412
+#endif
 #ifndef		BYTE_ORDER
 #define		BYTE_ORDER	LITTLE_ENDIAN
 #endif
diff --git a/src/include/port/univel.h b/src/include/port/univel.h
index f1a7afc83bb..9ce1fef1ccd 100644
--- a/src/include/port/univel.h
+++ b/src/include/port/univel.h
@@ -13,6 +13,15 @@ extern void srandom(int seed);
 extern int strcasecmp(char *s1,char *s2);
 extern int gethostname(char *name,int namelen);
 
+#ifndef		BIG_ENDIAN
+#define		BIG_ENDIAN	4321
+#endif
+#ifndef		LITTLE_ENDIAN
+#define		LITTLE_ENDIAN	1234
+#endif
+#ifndef		PDP_ENDIAN
+#define		PDP_ENDIAN	3412
+#endif
 #ifndef		BYTE_ORDER
 #define		BYTE_ORDER	LITTLE_ENDIAN
 #endif
-- 
GitLab