]> granicus.if.org Git - php/commitdiff
- Compile fix for systems without uint32_t typedef
authorfoobar <sniper@php.net>
Sat, 22 Jan 2005 20:28:17 +0000 (20:28 +0000)
committerfoobar <sniper@php.net>
Sat, 22 Jan 2005 20:28:17 +0000 (20:28 +0000)
Zend/Zend.m4
Zend/configure.in
Zend/zend_strtod.c

index eb24b3aca9d3d785c0e76810c581b3e6cd04b65f..21fcaa01e776f115baf44e900ebace7b10d2ecb5 100644 (file)
@@ -42,6 +42,8 @@ if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
 fi
 
 AC_CHECK_HEADERS(
+inttypes.h \
+stdint.h \
 limits.h \
 malloc.h \
 string.h \
@@ -82,6 +84,27 @@ dnl This is required for QNX and may be some BSD derived systems
 AC_CHECK_TYPE( uint, unsigned int )
 AC_CHECK_TYPE( ulong, unsigned long )
 
+dnl Check if uint32_t is defined
+AC_MSG_CHECKING(for uint32_t)
+AC_TRY_COMPILE([
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_INTTYPES_H
+#include <inttypes.h>
+#elif HAVE_STDINT_H
+#include <stdint.h>
+#endif],
+[if ((uint32_t *) 0)
+  return 0;
+if (sizeof (uint32_t))
+  return 0;
+],[
+  AC_DEFINE(HAVE_UINT32_T,1,[Define if uint32_t type is present. ])
+  AC_MSG_RESULT(yes)
+], AC_MSG_RESULT(no)
+)dnl
+
 dnl Checks for library functions.
 AC_FUNC_VPRINTF
 AC_FUNC_MEMCMP
index 67d35986639094c76fe19f1c06dc8bf2a7254c45..9cbd1e11cee01879183381e0cf04611b3cba30f9 100644 (file)
@@ -15,6 +15,9 @@ AC_ZEND_C_BIGENDIAN
 dnl We want this one before the checks, so the checks can modify CFLAGS.
 test -z "$CFLAGS" && auto_cflags=1
 
+AC_CHECK_SIZEOF(long, 8)
+AC_CHECK_SIZEOF(int, 4)
+
 sinclude(Zend.m4)
 
 LIBZEND_BASIC_CHECKS
index 52103bb355dd8bbc15eb660198b8c115c404e326..4891c336665814a837a511018c80c2ba282449fc 100644 (file)
  *     directly -- and assumed always to succeed.
  */
 
-/* $Id$ */
-
 #include <zend_strtod.h>
 
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
 #if defined(HAVE_INTTYPES_H)
 #include <inttypes.h>
 #elif defined(HAVE_STDINT_H)
 #include <stdint.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
+#ifndef HAVE_UINT32_T
+# if SIZEOF_INT == 4
+typedef unsigned int uint32_t;
+# elif SIZEOF_LONG == 4
+typedef unsigned long int uint32_t;
+# endif
 #endif
 
 #ifdef WORDS_BIGENDIAN