mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
- Compile fix for systems without int32_t typedef
This commit is contained in:
parent
ed9e8c7c81
commit
640bc001e5
45
Zend/Zend.m4
45
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 <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
|
||||
|
@ -101,6 +101,14 @@
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user