]> granicus.if.org Git - php/commitdiff
fix setting of 32-bit value on big-endian systems
authorGreg Beaver <cellog@php.net>
Sun, 15 Feb 2009 18:51:46 +0000 (18:51 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 15 Feb 2009 18:51:46 +0000 (18:51 +0000)
ext/phar/config.m4
ext/phar/tar.c

index 80a552ccea8a6aeab496bf67cc6f55e65abe17ab..a9894a2077fdf7afecd6c4212dedc563fe74521b 100644 (file)
@@ -6,10 +6,10 @@ PHP_ARG_ENABLE(phar, for phar archive support,
 
 if test "$PHP_PHAR" != "no"; then
   PHP_C_BIGENDIAN
-  if test $ac_cv_c_bigendian_php = yes; then
-    AC_MSG_WARN([Disabling Phar due to crash bugs on big endian systems])
-    PHP_PHAR=no
-  else
+dnl  if test $ac_cv_c_bigendian_php = yes; then
+dnl    AC_MSG_WARN([Disabling Phar due to crash bugs on big endian systems])
+dnl    PHP_PHAR=no
+dnl  else
   PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared)
   AC_MSG_CHECKING([for phar openssl support])
   if test "$PHP_HASH_SHARED" != "yes"; then
@@ -32,5 +32,5 @@ if test "$PHP_PHAR" != "no"; then
   PHP_ADD_EXTENSION_DEP(phar, hash, true)
   PHP_ADD_EXTENSION_DEP(phar, spl, true)
   PHP_ADD_MAKEFILE_FRAGMENT
-  fi
+dnl  fi
 fi
index 8a53989766a9131fa8df1388aaba0b740f4ed2d9..84789b1411806f3a96d7ff18465fe8e2b540d21e 100644 (file)
@@ -1084,10 +1084,10 @@ nostub:
 
 #ifdef WORDS_BIGENDIAN
 # define PHAR_SET_32(var, buffer) \
-       *(php_uint32 *)(var) = (((((unsigned char*)(buffer))[3]) << 24) \
-               | ((((unsigned char*)(buffer))[2]) << 16) \
-               | ((((unsigned char*)(buffer))[1]) << 8) \
-               | (((unsigned char*)(buffer))[0]))
+       *(php_uint32 *)(var) = (((((unsigned char*)&(buffer))[3]) << 24) \
+               | ((((unsigned char*)&(buffer))[2]) << 16) \
+               | ((((unsigned char*)&(buffer))[1]) << 8) \
+               | (((unsigned char*)&(buffer))[0]))
 #else
 # define PHAR_SET_32(var, buffer) *(php_uint32 *)(var) = (php_uint32) (buffer)
 #endif