| Jani Taskinen 2004-12-20, 8:56 pm |
| sniper Mon Dec 20 15:38:05 2004 EDT
Modified files: (Branch: PHP_5_0)
/php-src acinclude.m4 configure.in
/ZendEngine2 zend_strtod.c
Log:
MFH: endian compile problem fix
http://cvs.php.net/diff.php/php-src...=1.271.2.5&ty=u
Index: php-src/acinclude.m4
diff -u php-src/acinclude.m4:1.271.2.4 php-src/acinclude.m4:1.271.2.5
--- php-src/acinclude.m4:1.271.2.4 Sat Dec 11 06:17:14 2004
+++ php-src/acinclude.m4 Mon Dec 20 15:38:05 2004
@@ -1,4 +1,4 @@
-dnl $Id: acinclude.m4,v 1.271.2.4 2004/12/11 11:17:14 derick Exp $ -*- autoconf -*-
+dnl $Id: acinclude.m4,v 1.271.2.5 2004/12/20 20:38:05 sniper Exp $ -*- autoconf -*-
dnl
dnl This file contains local autoconf functions.
@@ -1932,3 +1932,32 @@
LIBS=$old_LIBS
])
])
+
+dnl
+dnl PHP_C_BIGENDIAN
+dnl Replacement macro for AC_C_BIGENDIAN
+dnl
+AC_DEFUN([PHP_C_BIGENDIAN],
+[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian_php,
+ [
+ ac_cv_c_bigendian_php=unknown
+ AC_TRY_RUN(
+ [
+int main(void)
+{
+ short one = 1;
+ char *cp = (char *)&one;
+
+ if (*cp == 0) {
+ return(0);
+ } else {
+ return(1);
+ }
+}
+ ], [ac_cv_c_bigendian_php=yes], [ac_cv_c_bigendian_php=no], [ac_cv_c_bigendian_php=unknown])
+ if test $ac_cv_c_bigendian_php = yes; then
+ AC_DEFINE(WORDS_BIGENDIAN)
+ fi
+ ])
+])
+
http://cvs.php.net/diff.php/php-src...1.514.2.27&ty=u
Index: php-src/configure.in
diff -u php-src/configure.in:1.514.2.26 php-src/configure.in:1.514.2.27
--- php-src/configure.in:1.514.2.26 Thu Dec 16 06:49:55 2004
+++ php-src/configure.in Mon Dec 20 15:38:05 2004
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.514.2.26 2004/12/16 11:49:55 sniper Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.514.2.27 2004/12/20 20:38:05 sniper Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -170,6 +170,10 @@
AC_MSG_WARN(You will need flex 2.5.4 or later if you want to regenerate Zend/PHP lexical parsers.)
fi
+dnl Check whether byte ordering is bigendian
+PHP_C_BIGENDIAN
+
+
dnl Platform-specific compile settings.
dnl -------------------------------------------------------------------------
http://cvs.php.net/diff.php/ZendEng...2=1.1.2.13&ty=u
Index: ZendEngine2/zend_strtod.c
diff -u ZendEngine2/zend_strtod.c:1.1.2.12 ZendEngine2/zend_strtod.c:1.1.2.13
--- ZendEngine2/zend_strtod.c:1.1.2.12 Fri Dec 17 08:17:25 2004
+++ ZendEngine2/zend_strtod.c Mon Dec 20 15:38:05 2004
@@ -91,22 +91,15 @@
#include <zend_strtod.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strtod.c,v 1.19 2004/02/03 16:52:11 drahn Exp $";
-#endif /* LIBC_SCCS and not lint */
-
-#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \
- defined(__mips__) || defined(__mips) || defined(__ns32k__) || defined(__alpha__) || defined(__alpha) || \
- defined(__powerpc__) || defined(__ppc__) || defined(__m88k__) || defined(__hpux) || \
- defined(__hppa__) || defined(__x86_64__) || (defined(__arm__) && \
- defined(__VFP_FP__))
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
-#if BYTE_ORDER == BIG_ENDIAN
+#endif
+
+#ifdef WORDS_BIGENDIAN
#define IEEE_BIG_ENDIAN
#else
#define IEEE_LITTLE_ENDIAN
#endif
-#endif
#if defined(__arm__) && !defined(__VFP_FP__)
/*
|