From: foobar Date: Thu, 17 Feb 2005 04:44:52 +0000 (+0000) Subject: - Compile fix for systems without int32_t typedef X-Git-Tag: RELEASE_0_2_4~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=640bc001e5a60607ce7821c2dcd3871057971675;p=php - Compile fix for systems without int32_t typedef --- diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 21fcaa01e7..6aa9e990b5 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -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 +#endif +#if HAVE_INTTYPES_H +#include +#elif HAVE_STDINT_H +#include +#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 -#endif -#if HAVE_INTTYPES_H -#include -#elif HAVE_STDINT_H -#include -#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 diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index cd60232c1b..87d755006a 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -101,6 +101,14 @@ #include #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;