]> granicus.if.org Git - php/commitdiff
- Compile fix for systems without int32_t typedef
authorfoobar <sniper@php.net>
Thu, 17 Feb 2005 04:44:52 +0000 (04:44 +0000)
committerfoobar <sniper@php.net>
Thu, 17 Feb 2005 04:44:52 +0000 (04:44 +0000)
Zend/Zend.m4
Zend/zend_strtod.c

index 21fcaa01e776f115baf44e900ebace7b10d2ecb5..6aa9e990b5a352596b2a523b2501f426e7fc62ac 100644 (file)
@@ -19,6 +19,28 @@ fi
 
 ])
 
+AC_DEFUN([LIBZEND_CHECK_INT_TYPE],[
+AC_MSG_CHECKING(for $1)
+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 (($1 *) 0)
+  return 0;
+if (sizeof ($1))
+  return 0;
+],[
+  AC_DEFINE_UNQUOTED([HAVE_]translit($1,a-z_-,A-Z__), 1,[Define if $1 type is present. ])
+  AC_MSG_RESULT(yes)
+], AC_MSG_RESULT(no)
+)dnl
+])
+
 AC_DEFUN([LIBZEND_BASIC_CHECKS],[
 
 AC_REQUIRE([AC_PROG_YACC])
@@ -84,26 +106,9 @@ 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 Check if int32_t and uint32_t are defined
+LIBZEND_CHECK_INT_TYPE(int32_t)
+LIBZEND_CHECK_INT_TYPE(uint32_t)
 
 dnl Checks for library functions.
 AC_FUNC_VPRINTF
index cd60232c1b032f4a260043b4d2286ed67f2e6a6b..87d755006a4e0f445e31aaee07dbf15e566f210f 100644 (file)
 #include <stdint.h>
 #endif
 
+#ifndef HAVE_INT32_T
+# if SIZEOF_INT == 4
+typedef int int32_t;
+# elif SIZEOF_LONG == 4
+typedef long int int32_t;
+# endif
+#endif
+
 #ifndef HAVE_UINT32_T
 # if SIZEOF_INT == 4
 typedef unsigned int uint32_t;