fix setting of 32-bit value on big-endian systems

This commit is contained in:
Greg Beaver 2009-02-15 18:51:46 +00:00
parent 0502920928
commit d3cea8b054
2 changed files with 9 additions and 9 deletions

View 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

View 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