andrey Mon Nov 3 18:07:41 2008 UTC Modified files: /php-src/ext/mysqlnd config-win.h Log: Fix the windows build http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/config-win.h?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/mysqlnd/config-win.h diff -u php-src/ext/mysqlnd/config-win.h:1.1 php-src/ext/mysqlnd/config-win.h:1.2 --- php-src/ext/mysqlnd/config-win.h:1.1 Wed Jul 25 23:47:32 2007 +++ php-src/ext/mysqlnd/config-win.h Mon Nov 3 18:07:40 2008 @@ -39,10 +39,12 @@ /* Type information */ +/* typedef unsigned short ushort; typedef unsigned int uint; -typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ +typedef unsigned __int64 ulonglong; typedef __int64 longlong; +*/ typedef int sigset_t; #define longlong_defined @@ -54,45 +56,45 @@ #ifndef _WIN64 /* Optimized store functions for Intel x86 */ -#define sint2korr(A) (*((int16 *) (A))) -#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \ - (((uint32) 255L << 24) | \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0])) : \ - (((uint32) (uchar) (A)[2]) << 16) |\ - (((uint32) (uchar) (A)[1]) << 8) | \ - ((uint32) (uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) -#define uint2korr(A) (*((uint16 *) (A))) -#define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF) -#define uint4korr(A) (*((unsigned long *) (A))) -#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ - (((uint32) ((uchar) (A)[1])) << 8) +\ - (((uint32) ((uchar) (A)[2])) << 16) +\ - (((uint32) ((uchar) (A)[3])) << 24)) +\ - (((ulonglong) ((uchar) (A)[4])) << 32)) -#define uint8korr(A) (*((ulonglong *) (A))) -#define sint8korr(A) (*((longlong *) (A))) -#define int2store(T,A) *((uint16*) (T))= (uint16) (A) +#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]))) +#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)) +#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) (((uint) (A) >> 8));\ + *(T+1)=(uchar) (((uint32_t) (A) >> 8));\ *(T+2)=(uchar) (((A) >> 16)); } -#define int4store(T,A) *((long *) (T))= (long) (A) +#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 int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) +#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A) -#define doubleget(V,M) { *((long *) &V) = *((long*) M); \ - *(((long *) &V)+1) = *(((long*) M)+1); } -#define doublestore(T,V) { *((long *) T) = *((long*) &V); \ - *(((long *) T)+1) = *(((long*) &V)+1); } -#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); } +#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 float4get(V,M) { *((int32_t *) &(V)) = *((int32_t*) (M)); } #define float8get(V,M) doubleget((V),(M)) -#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float)) +#define float4store(V,M) memcpy((char*) V,(char*) (&M),sizeof(float)) #define float8store(V,M) doublestore((V),(M)) #endif /* _WIN64 */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php