]> granicus.if.org Git - php/commitdiff
MFH: endian compile problem fix
authorfoobar <sniper@php.net>
Mon, 20 Dec 2004 20:38:05 +0000 (20:38 +0000)
committerfoobar <sniper@php.net>
Mon, 20 Dec 2004 20:38:05 +0000 (20:38 +0000)
Zend/zend_strtod.c
acinclude.m4
configure.in

index d0b197335d134379dddccd71432f43fbe2fe059d..bba9ac7edb0b298a64031314749187d62c7e92ba 100644 (file)
 
 #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__)
 /*
index e9737e9d80a78054491b7448d3733a1455ff9de4..3d007b3081d37cebb4d4ab7a3deac1829c05b5b1 100644 (file)
@@ -1932,3 +1932,32 @@ AC_DEFUN(PHP_TEST_BUILD, [
     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
+ ])
+])
+
index 49e9be67a970cdbbaa51e1379e26c6266bc94ce4..7dd063ec2931f3062443fce018a884f41c1bac56 100644 (file)
@@ -170,6 +170,10 @@ else
        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 -------------------------------------------------------------------------