]> granicus.if.org Git - php/commitdiff
- #50334, fix build for platform without endian.h (like solaris)
authorPierre Joye <pajoye@php.net>
Wed, 9 Dec 2009 17:40:19 +0000 (17:40 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 9 Dec 2009 17:40:19 +0000 (17:40 +0000)
ext/standard/crypt_sha256.c
ext/standard/crypt_sha512.c

index 447071b39c35bcb569baf68ade88157ca5eb7a5f..dc2c4ce20ccbe2a371ca70f5f43e544da3c6784c 100644 (file)
@@ -3,7 +3,6 @@
 /* Windows VC++ port by Pierre Joye <pierre@php.net> */
 
 #ifndef PHP_WIN32
-# include <endian.h>
 # include "php.h"
 # include "php_main.h"
 #endif
@@ -75,7 +74,7 @@ struct sha256_ctx {
        char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
 };
 
-#if PHP_WIN32 || (__BYTE_ORDER == __LITTLE_ENDIAN)
+#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
 # define SWAP(n) \
     (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
 #else
index 065721a5ef385354753e300e7580d78b265ed224..cdf8851684e20f5971f4c9f4413b5769d69a852d 100644 (file)
@@ -3,7 +3,6 @@
 /* Windows VC++ port by Pierre Joye <pierre@php.net> */
 
 #ifndef PHP_WIN32
-# include <endian.h>
 # include "php.h"
 # include "php_main.h"
 #endif
@@ -66,7 +65,7 @@ struct sha512_ctx
 };
 
 
-#if PHP_WIN32 || (__BYTE_ORDER == __LITTLE_ENDIAN)
+#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
 # define SWAP(n) \
   (((n) << 56)                                 \
    | (((n) & 0xff00) << 40)                    \