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

index 49e14a60b2287b49970c12418638cd2c2bedf0ed..bf0c70d7dff9f39801b5e9785cc0dc5f8ad07255 100644 (file)
@@ -136,6 +136,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 1d2ff86e3f6e9b1dec8f5b00968f7b6ac17bb2e2..d55553bced2529f399f307e779ed316fc655d8f1 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; \