solaris: handle big-endian
authorluk65 <luk65@user.github.invalid.com>
Thu, 23 Mar 2017 15:56:25 +0000 (23:56 +0800)
committerAndy Green <andy@warmcat.com>
Thu, 23 Mar 2017 22:51:06 +0000 (06:51 +0800)
https://github.com/warmcat/libwebsockets/issues/846

lib/private-libwebsockets.h

index d902541d7e6b8f853dffb89cc01fd0e2846ed9e6..3b4d7ff7c3ed68d3c977cbff5a46f08f5f2635e7 100644 (file)
@@ -370,11 +370,23 @@ extern "C" {
 #endif
 
 #if defined(__sun) && defined(__GNUC__)
+
+#include <arpa/nameser_compat.h>
+
+#if !defined (BYTE_ORDER)
 # define BYTE_ORDER __BYTE_ORDER__
+#endif
+
+#if !defined(LITTLE_ENDIAN)
 # define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
+#endif
+
+#if !defined(BIG_ENDIAN)
 # define BIG_ENDIAN __ORDER_BIG_ENDIAN__
 #endif
 
+#endif /* sun + GNUC */
+
 #if !defined(BYTE_ORDER)
 # define BYTE_ORDER __BYTE_ORDER
 #endif