diff options
Diffstat (limited to 'ext/mysqlnd/mysqlnd_portability.h')
-rw-r--r-- | ext/mysqlnd/mysqlnd_portability.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/mysqlnd/mysqlnd_portability.h b/ext/mysqlnd/mysqlnd_portability.h index 72a156a795..d9936e0425 100644 --- a/ext/mysqlnd/mysqlnd_portability.h +++ b/ext/mysqlnd/mysqlnd_portability.h @@ -194,13 +194,13 @@ This file is public domain and comes with NO WARRANTY of any kind */ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0]))) -#define sint4korr(A) (*((long *) (A))) +#define sint4korr(A) (*((php_int_t *) (A))) #define uint2korr(A) (*((uint16_t *) (A))) #define uint3korr(A) (uint32_t) (((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16)) -#define uint4korr(A) (*((unsigned long *) (A))) +#define uint4korr(A) (*((php_uint_t *) (A))) @@ -211,7 +211,7 @@ This file is public domain and comes with NO WARRANTY of any kind */ *(T)= (zend_uchar) ((A));\ *(T+1)=(zend_uchar) (((uint32_t) (A) >> 8));\ *(T+2)=(zend_uchar) (((A) >> 16)); } -#define int4store(T,A) *((long *) (T))= (long) (A) +#define int4store(T,A) *((php_int_t *) (T))= (php_int_t) (A) #define int5store(T,A) { \ *((zend_uchar *)(T))= (zend_uchar)((A));\ *(((zend_uchar *)(T))+1)=(zend_uchar) (((A) >> 8));\ @@ -232,12 +232,12 @@ This file is public domain and comes with NO WARRANTY of any kind */ typedef union { double v; - long m[2]; + php_int_t m[2]; } float8get_union; -#define float8get(V,M) { ((float8get_union *)&(V))->m[0] = *((long*) (M)); \ - ((float8get_union *)&(V))->m[1] = *(((long*) (M))+1); } -#define float8store(T,V) { *((long *) (T)) = ((float8get_union *)&(V))->m[0]; \ - *(((long *) (T))+1) = ((float8get_union *)&(V))->m[1]; } +#define float8get(V,M) { ((float8get_union *)&(V))->m[0] = *((php_int_t*) (M)); \ + ((float8get_union *)&(V))->m[1] = *(((php_int_t*) (M))+1); } +#define float8store(T,V) { *((php_int_t *) (T)) = ((float8get_union *)&(V))->m[0]; \ + *(((php_int_t *) (T))+1) = ((float8get_union *)&(V))->m[1]; } #define float4get(V,M) { *((float *) &(V)) = *((float*) (M)); } /* From Andrey Hristov based on float8get */ #define floatget(V,M) memcpy((char*) &(V),(char*) (M),sizeof(float)) |