]> granicus.if.org Git - php/commitdiff
detect endianness in compile time when using Apple's GCC (fixes universal binary...
authorAntony Dovgal <tony2001@php.net>
Tue, 4 Sep 2007 18:46:08 +0000 (18:46 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 4 Sep 2007 18:46:08 +0000 (18:46 +0000)
Zend/zend_strtod.c
ext/date/lib/parse_tz.c
ext/hash/hash_tiger.c

index 411a4cd1e3ebefae39c8661a6d62008e8cd2ad34..fad9594105916e0826dbc3d1348eab821e511397 100644 (file)
@@ -138,6 +138,16 @@ typedef unsigned long int uint32_t;
 # endif
 #endif
 
+#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+# if defined(__LITTLE_ENDIAN__)
+#  undef WORDS_BIGENDIAN
+# else 
+#  if defined(__BIG_ENDIAN__)
+#   define WORDS_BIGENDIAN
+#  endif
+# endif
+#endif
+
 #ifdef WORDS_BIGENDIAN
 #define IEEE_BIG_ENDIAN
 #else
index 31e42dec8465617d11258d93d425bec5ea7cd631..39e814db9fdd215e228adf62bf1d8a8b1067c0af 100644 (file)
 #endif
 #include "timezonedb.h"
 
+#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+# if defined(__LITTLE_ENDIAN__)
+#  undef WORDS_BIGENDIAN
+# else 
+#  if defined(__BIG_ENDIAN__)
+#   define WORDS_BIGENDIAN
+#  endif
+# endif
+#endif
+
 #ifdef WORDS_BIGENDIAN
 #define timelib_conv_int(l) (l)
 #else
index 6e3e7dc2b720dd833c58f76e7c0cb6194c58267a..5309cb7182aba939b6939b1ab6fd5d0869b2439d 100644 (file)
 #include "php_hash_tiger.h"
 #include "php_hash_tiger_tables.h"
 
+#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+# if defined(__LITTLE_ENDIAN__)
+#  undef WORDS_BIGENDIAN
+# else 
+#  if defined(__BIG_ENDIAN__)
+#   define WORDS_BIGENDIAN
+#  endif
+# endif
+#endif
+
 /* {{{ */
 #define save_abc \
        aa = a; \