--- ./bytesex.h	2003-08-31 17:23:48.000000000 +0000
+++ ../bytesex.h.orig	2018-03-11 08:02:45.020774804 +0000
@@ -7,17 +7,11 @@
 #ifndef ARS_BYTESEX_H
 #define ARS_BYTESEX_H
 
-#if 	defined(__i386__) \
-	|| defined(__alpha__) \
-	|| (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))
-#define BYTE_ORDER_LITTLE_ENDIAN
-#elif 	defined(__mc68000__) \
-	|| defined (__sparc__) \
-	|| defined (__sparc) \
-	|| defined (__PPC__) \
-	|| defined (__BIG_ENDIAN__) \
-	|| (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))
-#define BYTE_ORDER_BIG_ENDIAN
+#include <endian.h>
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+# define BYTE_ORDER_LITTLE_ENDIAN
+#elif __BYTE_ORDER == __BIG_ENDIAN
+# define BYTE_ORDER_BIG_ENDIAN
 #else
 # error can not find the byte order for this architecture, fix bytesex.h
 #endif
