Author: ahristov
Date: 2007-07-05 08:39:56 +0200 (Thu, 05 Jul 2007)
New Revision: 643
Modified:
trunk/mysqlnd/portability.h
trunk/php6/ext/mysqli/config9.m4
Log:
More on portability. Check for C99 types in config9.m4
If C99 types are available typedef them to our.
Modified: trunk/mysqlnd/portability.h
===================================================================
--- trunk/mysqlnd/portability.h 2007-07-05 06:08:01 UTC (rev 642)
+++ trunk/mysqlnd/portability.h 2007-07-05 06:39:56 UTC (rev 643)
@@ -51,36 +51,64 @@
/* Typdefs for easyier portability */
#ifndef HAVE_INT8
-typedef signed char int8; /* Signed integer >= 8 bits */
+#ifndef HAVE_INT8_T
+typedef signed char int8; /* Signed integer >= 8 bits */
+#else
+typedef int8_t int8; /* Signed integer >= 8 bits */
#endif
+#endif
+
#ifndef HAVE_UINT8
-typedef unsigned char uint8; /* Signed integer >= 8 bits */
+#ifndef HAVE_UINT8_T
+typedef unsigned char uint8; /* Unsigned integer >= 8 bits */
+#else
+typedef uint8_t uint8; /* Signed integer >= 8 bits */
#endif
+#endif
+
#ifndef HAVE_INT16
-typedef signed short int16; /* Signed integer >= 16 bits */
+#ifndef HAVE_INT16_T
+typedef signed short int16; /* Signed integer >= 16 bits */
+#else
+typedef int16_t int16; /* Signed integer >= 16 bits */
#endif
+#endif
+
#ifndef HAVE_UINT16
-typedef unsigned short uint16; /* Signed integer >= 16 bits */
+#ifndef HAVE_UINT16_T
+typedef unsigned short uint16; /* Signed integer >= 16 bits */
+#else
+typedef uint16_t uint16; /* Signed integer >= 16 bits */
#endif
+#endif
#ifndef HAVE_UCHAR
-typedef unsigned char uchar; /* Short for unsigned char */
+typedef unsigned char uchar; /* Short for unsigned char */
#endif
-#if SIZEOF_INT == 4
+
+#if defined(HAVE_INT32_T) && defined (HAVE_UINT32_T)
+typedef int32_t int32;
+typedef uint32_t uint32;
+
+#elif SIZEOF_INT == 4
+
#ifndef HAVE_INT32
typedef signed int int32;
#endif
#ifndef HAVE_UINT32
-typedef unsigned int uint32; /* Short for unsigned integer >= 32 bits */
+typedef unsigned int uint32;
#endif
+
#elif SIZEOF_LONG == 4
+
#ifndef HAVE_INT32
typedef signed long int32;
#endif
#ifndef HAVE_UINT32
-typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
+typedef unsigned long uint32;
#endif
+
#else
error "Neither int or long is of 4 bytes width"
#endif
@@ -392,11 +420,21 @@
#ifndef L64
#define L64(x) x##LL
#endif
+#ifndef HAVE_UINT64_T
typedef unsigned long long my_uint64;
+typedef unsigned long long mynd_ulonglong;
+#else
+typedef uint64_t my_uint64;
+typedef uint64_t mynd_ulonglong;
+#endif
+#ifndef HAVE_INT64_T
typedef long long my_int64;
-typedef unsigned long long mynd_ulonglong;
typedef long long mynd_longlong;
+#else
+typedef int64_t my_int64;
+typedef int64_t mynd_longlong;
#endif
+#endif
/*
Modified: trunk/php6/ext/mysqli/config9.m4
===================================================================
--- trunk/php6/ext/mysqli/config9.m4 2007-07-05 06:08:01 UTC (rev 642)
+++ trunk/php6/ext/mysqli/config9.m4 2007-07-05 06:39:56 UTC (rev 643)
@@ -6,6 +6,10 @@
#include <sys/types.h>
])
+AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t,
uint64_t],[],[], [
+#include <stdint.h>
+])
+
PHP_ARG_WITH(mysqli, for MySQLi support,
[ --with-mysqli[=FILE] Include MySQLi support. FILE is the optional pathname to
mysql_config.
If mysqlnd is passed as FILE, the MySQL native driver will be
used])
| Thread |
|---|
| • PHP mysqlnd svn commit: r643 - in trunk: mysqlnd php6/ext/mysqli | ahristov | 5 Jul |