]> granicus.if.org Git - php/commitdiff
Rely on win32/php_stdint.h on Windows for stdint types
authorAndrey Hristov <andrey@php.net>
Thu, 6 Nov 2008 14:20:19 +0000 (14:20 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 6 Nov 2008 14:20:19 +0000 (14:20 +0000)
ext/mysqlnd/config-win.h
ext/mysqlnd/mysqlnd_portability.h

index 0d890f7166309c25319a855060cf1b07d860d580..15cd736b102b57e1eabba51038a45d6d2455300d 100644 (file)
@@ -10,6 +10,33 @@ This file is public domain and comes with NO WARRANTY of any kind */
 #include <io.h>
 #include <malloc.h>
 
+#include "win32/php_stdint.h"
+
+#ifndef HAVE_INT8_T
+#define HAVE_INT8_T
+#endif
+#ifndef HAVE_UINT8_T
+#define HAVE_UINT8_T
+#endif
+#ifndef HAVE_INT16_T
+#define HAVE_INT16_T
+#endif
+#ifndef HAVE_UINT16_T
+#define HAVE_UINT16_T
+#endif
+#ifndef HAVE_INT32_T
+#define HAVE_INT32_T
+#endif
+#ifndef HAVE_UINT32_T
+#define HAVE_UINT32_T
+#endif
+#ifndef HAVE_INT64_T
+#define HAVE_INT64_T
+#endif
+#ifndef HAVE_UINT64_T
+#define HAVE_UINT64_T
+#endif
+
 
 #ifndef _WIN64
 #ifndef _WIN32
index cdc627339780b327e627f1c2c5bb8601bb55a203..3658dbf750b919af23ca75b060c916c0f37e12f2 100644 (file)
@@ -60,7 +60,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
 #endif
 
 /* Typdefs for easyier portability */
-
+#if 0
 #ifndef HAVE_INT8_T
 #ifndef HAVE_INT8
 typedef signed char int8_t;                    /* Signed integer >= 8    bits */
@@ -69,7 +69,6 @@ typedef int8 int8_t;                          /* Signed integer >= 8    bits */
 #endif
 #endif
 
-
 #ifndef HAVE_UINT8_T
 #ifndef HAVE_UINT8
 typedef unsigned char uint8_t;         /* Unsigned integer >= 8    bits */
@@ -110,7 +109,6 @@ error "Neither int nor long is of 4 bytes width"
 #endif
 #endif /* HAVE_INT32_T */
 
-
 #ifndef HAVE_UINT32_T
 #ifdef HAVE_UINT32
 typedef uint32 uint32_t;
@@ -123,7 +121,6 @@ typedef unsigned long uint32_t;
 #endif
 #endif /* HAVE_UINT32_T */
 
-
 #ifndef HAVE_INT64_T
 #ifdef HAVE_INT64
 typedef int64 int64_t;
@@ -142,7 +139,6 @@ typedef signed long long int64_t;
 #endif
 #endif /* HAVE_INT64_T */
 
-
 #ifndef HAVE_UINT64_T
 #ifdef HAVE_UINT64
 typedef uint64 uint64_t;
@@ -161,6 +157,7 @@ typedef unsigned long long uint64_t;
 #endif
 #endif /* HAVE_INT64_T */
 
+#endif
 
 #ifdef PHP_WIN32
 #define MYSQLND_LLU_SPEC "%I64u"
@@ -179,7 +176,7 @@ typedef unsigned long long uint64_t;
 #endif
 
 
-#define int1store(T,A) do { *((zend_uchar*) (T)) = (A); } while(0)
+#define int1store(T,A) do { *((int8_t*) (T)) = (A); } while(0)
 #define uint1korr(A)   (*(((uint8_t*)(A))))
 
 /* Bit values are sent in reverted order of bytes, compared to normal !!! */
@@ -231,7 +228,7 @@ typedef unsigned long long uint64_t;
 **  (low byte first)
 */
 
-/* Optimized store functions for Intel x86, non-valid for WIN64 */
+/* Optimized store functions for Intel x86, non-valid for WIN64. __i386__ is GCC */
 #if defined(__i386__) && !defined(_WIN64)
 #define sint2korr(A)    (*((int16_t *) (A)))
 #define sint3korr(A)    ((int32_t) ((((uchar) (A)[2]) & 128) ? \