summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/config-win.h
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2008-11-06 10:36:30 +0000
committerAndrey Hristov <andrey@php.net>2008-11-06 10:36:30 +0000
commit0b46d6b5a53efb4e9093757f437c3057cc3818d6 (patch)
treec8baa8ea5fe53b4e7860c4773c8e3ca8ea56f139 /ext/mysqlnd/config-win.h
parenta5368aeb7362d9135e5462d478d3631afccd44d1 (diff)
downloadphp-git-0b46d6b5a53efb4e9093757f437c3057cc3818d6.tar.gz
Get rid of many defines (which simplifies the code a lot),
as well as uint->unsigned int
Diffstat (limited to 'ext/mysqlnd/config-win.h')
-rw-r--r--ext/mysqlnd/config-win.h57
1 files changed, 24 insertions, 33 deletions
diff --git a/ext/mysqlnd/config-win.h b/ext/mysqlnd/config-win.h
index 104df4fc4c..485f88258c 100644
--- a/ext/mysqlnd/config-win.h
+++ b/ext/mysqlnd/config-win.h
@@ -18,10 +18,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
#define SYSTEM_TYPE "Win95/Win98"
#endif
-#ifdef _WIN64
-#define MACHINE_TYPE "ia64" /* Define to machine type name */
-#else
-#define MACHINE_TYPE "i32" /* Define to machine type name */
+#ifndef _WIN64
#ifndef _WIN32
#define _WIN32 /* Compatible with old source */
#endif
@@ -40,10 +37,7 @@ This file is public domain and comes with NO WARRANTY of any kind */
/* Type information */
/*
-typedef unsigned short ushort;
typedef unsigned int uint;
-typedef unsigned __int64 ulonglong;
-typedef __int64 longlong;
*/
typedef int sigset_t;
#define longlong_defined
@@ -58,43 +52,40 @@ typedef int sigset_t;
#define sint2korr(A) (*((int16_t *) (A)))
#define sint3korr(A) ((int32_t) ((((uchar) (A)[2]) & 128) ? \
- (((uint32_t) 255L << 24) | \
- (((uint32_t) (uchar) (A)[2]) << 16) |\
- (((uint32_t) (uchar) (A)[1]) << 8) | \
- ((uint32_t) (uchar) (A)[0])) : \
- (((uint32_t) (uchar) (A)[2]) << 16) |\
- (((uint32_t) (uchar) (A)[1]) << 8) | \
- ((uint32_t) (uchar) (A)[0])))
+ (((uint32_t) 255L << 24) | \
+ (((uint32_t) (uchar) (A)[2]) << 16) |\
+ (((uint32_t) (uchar) (A)[1]) << 8) | \
+ ((uint32_t) (uchar) (A)[0])) : \
+ (((uint32_t) (uchar) (A)[2]) << 16) |\
+ (((uint32_t) (uchar) (A)[1]) << 8) | \
+ ((uint32_t) (uchar) (A)[0])))
#define sint4korr(A) (*((int32_t *) (A)))
#define uint2korr(A) (*((uint16_t *) (A)))
#define uint3korr(A) (int32_t) (*((uint32_t *) (A)) & 0xFFFFFF)
#define uint4korr(A) (*((uint32_t *) (A)))
#define uint5korr(A) ((uint64_t)(((uint32_t) ((uchar) (A)[0])) +\
- (((uint32_t) ((uchar) (A)[1])) << 8) +\
- (((uint32_t) ((uchar) (A)[2])) << 16) +\
- (((uint32_t) ((uchar) (A)[3])) << 24)) +\
- (((uint64_t) ((uchar) (A)[4])) << 32))
+ (((uint32_t) ((uchar) (A)[1])) << 8) +\
+ (((uint32_t) ((uchar) (A)[2])) << 16) +\
+ (((uint32_t) ((uchar) (A)[3])) << 24)) +\
+ (((uint64_t) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((uint64_t *) (A)))
#define sint8korr(A) (*((int64_t *) (A)))
#define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A)
-#define int3store(T,A) { *(T)= (uchar) ((A));\
- *(T+1)=(uchar) (((uint32_t) (A) >> 8));\
- *(T+2)=(uchar) (((A) >> 16)); }
+#define int3store(T,A) { *(T)= (uchar) ((A));\
+ *(T+1)=(uchar) (((uint32_t) (A) >> 8));\
+ *(T+2)=(uchar) (((A) >> 16)); }
#define int4store(T,A) *((int32_t *) (T))= (int32_t) (A)
-#define int5store(T,A) { *(T)= (uchar)((A));\
- *((T)+1)=(uchar) (((A) >> 8));\
- *((T)+2)=(uchar) (((A) >> 16));\
- *((T)+3)=(uchar) (((A) >> 24)); \
- *((T)+4)=(uchar) (((A) >> 32)); }
+#define int5store(T,A) { *(T)= (uchar)((A));\
+ *((T)+1)=(uchar) (((A) >> 8));\
+ *((T)+2)=(uchar) (((A) >> 16));\
+ *((T)+3)=(uchar) (((A) >> 24)); \
+ *((T)+4)=(uchar) (((A) >> 32)); }
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
-#define doubleget(V,M) { *((int32_t *) &V) = *((int32_t*) M); \
- *(((int32_t *) &V)+1) = *(((int32_t*) M)+1); }
-#define doublestore(T,V) { *((int32_t *) T) = *((int32_t*) &V); \
- *(((int32_t *) T)+1) = *(((int32_t*) &V)+1); }
+#define float8get(V,M) { *((int32_t *) &V) = *((int32_t*) M); \
+ *(((int32_t *) &V)+1) = *(((int32_t*) M)+1); }
+#define float8store(T,V) { *((int32_t *) T) = *((int32_t*) &V); \
+ *(((int32_t *) T)+1) = *(((int32_t*) &V)+1); }
#define float4get(V,M) { *((int32_t *) &(V)) = *((int32_t*) (M)); }
-#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((char*) V,(char*) (&M),sizeof(float))
-#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */