summaryrefslogtreecommitdiff
path: root/libraries/pjproject-ring/patches/endianness.patch
blob: 84b9499448f65d588082fd4047906cb1295541dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index 10f86fd..4ace1bc 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -245,7 +245,13 @@
 #   define PJ_M_NAME		"armv4"
 #   define PJ_HAS_PENTIUM	0
 #   if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
-#   	error Endianness must be declared for this processor
+#       if defined(__GNUC__)
+#           include <endian.h>
+#           define PJ_IS_LITTLE_ENDIAN  __BYTE_ORDER__ == __LITTLE_ENDIAN__
+#           define PJ_IS_BIG_ENDIAN     __BYTE_ORDER__ == __BIG_ENDIAN__
+#       else
+#           error Endianness must be declared for this processor
+#       endif
 #   endif
 
 #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \