[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Mon, 04 Oct 2010 12:41:12 + Revision: http://svn.php.net/viewvc?view=revision&revision=303995 Log: don't define twice the macro on some platforms Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:37:43 UTC (rev 303994) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:41:12 UTC (rev 303995) @@ -483,8 +483,10 @@ #ifdef WORDS_BIGENDIAN +#ifndef float8get #define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) +#endif /* float8get */ #else Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:37:43 UTC (rev 303994) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:41:12 UTC (rev 303995) @@ -483,8 +483,10 @@ #ifdef WORDS_BIGENDIAN +#ifndef float8get #define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) +#endif /* float8get */ #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Mon, 04 Oct 2010 12:59:29 + Revision: http://svn.php.net/viewvc?view=revision&revision=304001 Log: Even better patch Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:55:08 UTC (rev 304000) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:59:29 UTC (rev 304001) @@ -481,22 +481,18 @@ short/long to/from some place in memory V should be a (not register) variable, M is a pointer to byte */ -#ifdef WORDS_BIGENDIAN - #ifndef float8get + +#ifdef WORDS_BIGENDIAN #define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) -#endif /* float8get */ - #else - -#ifndef float8get #define float8get(V,M)memcpy((char*) &(V),(char*) (M),sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double)) -#endif /* float8get */ - #endif /* WORDS_BIGENDIAN */ +#endif /* float8get */ + #endif /* MYSQLND_PORTABILITY_H */ Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:55:08 UTC (rev 304000) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-10-04 12:59:29 UTC (rev 304001) @@ -481,22 +481,18 @@ short/long to/from some place in memory V should be a (not register) variable, M is a pointer to byte */ -#ifdef WORDS_BIGENDIAN - #ifndef float8get + +#ifdef WORDS_BIGENDIAN #define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) -#endif /* float8get */ - #else - -#ifndef float8get #define float8get(V,M)memcpy((char*) &(V),(char*) (M),sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double)) -#endif /* float8get */ - #endif /* WORDS_BIGENDIAN */ +#endif /* float8get */ + #endif /* MYSQLND_PORTABILITY_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Mon, 31 May 2010 16:51:03 + Revision: http://svn.php.net/viewvc?view=revision&revision=24 Log: try to workaround problems with non-c99 on HPUX Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-05-31 14:37:39 UTC (rev 23) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-05-31 16:51:03 UTC (rev 24) @@ -38,6 +38,12 @@ # include #endif /* _WIN32... */ +#if __STDC_VERSION__ < 199901L && !defined(atoll) + /* "inline" is a keyword */ + #define atoll atol +#endif + + #ifdef HAVE_SYS_TYPES_H #include #endif Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-05-31 14:37:39 UTC (rev 23) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-05-31 16:51:03 UTC (rev 24) @@ -12,6 +12,8 @@ #ifndef MYSQLND_PORTABILITY_H #define MYSQLND_PORTABILITY_H + + /* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */ #define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) @@ -38,6 +40,12 @@ # include #endif /* _WIN32... */ +#if __STDC_VERSION__ < 199901L && !defined(atoll) + /* "inline" is a keyword */ + #define atoll atol +#endif + + #ifdef HAVE_SYS_TYPES_H #include #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Thu, 14 Jan 2010 10:35:28 + Revision: http://svn.php.net/viewvc?view=revision&revision=293537 Log: remove redefinition of bit_uint8korr Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-01-14 10:32:05 UTC (rev 293536) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2010-01-14 10:35:28 UTC (rev 293537) @@ -369,16 +369,6 @@ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[3])) << 24)) - -#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[7])) +\ - (((uint32_t) (((zend_uchar*) (A))[6])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[5])) << 16) +\ - (((uint32_t) (((zend_uchar*) (A))[4])) << 24)) +\ - (((uint64_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\ - (((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\ - (((uint32_t) (((zend_uchar*) (A))[0])) << 24))) << 32)) - #define uint8korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-01-14 10:32:05 UTC (rev 293536) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2010-01-14 10:35:28 UTC (rev 293537) @@ -369,16 +369,6 @@ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[3])) << 24)) - -#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[7])) +\ - (((uint32_t) (((zend_uchar*) (A))[6])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[5])) << 16) +\ - (((uint32_t) (((zend_uchar*) (A))[4])) << 24)) +\ - (((uint64_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\ - (((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\ - (((uint32_t) (((zend_uchar*) (A))[0])) << 24))) << 32)) - #define uint8korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Wed, 09 Dec 2009 18:11:03 + Revision: http://svn.php.net/viewvc?view=revision&revision=291926 Log: Fix compilation warnings Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-12-09 17:47:38 UTC (rev 291925) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-12-09 18:11:03 UTC (rev 291926) @@ -235,49 +235,46 @@ #define uint1korr(A) (*(((uint8_t*)(A /* Bit values are sent in reverted order of bytes, compared to normal !!! */ -#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((zend_uchar*) (A))[1])) +\ - ((uint16_t) (((zend_uchar*) (A))[0]) << 8))) -#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[2])) +\ - (((uint32_t) (((zend_uchar*) (A))[1])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[0])) << 16))) +#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((unsigned char*) (A))[1])) +\ + ((uint16_t) (((unsigned char*) (A))[0]) << 8))) +#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[2])) +\ + (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\ + (((uint32_t) (((unsigned char*) (A))[0])) << 16))) +#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[3])) +\ + (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\ + (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\ + (((uint32_t) (((unsigned char*) (A))[0])) << 24))) +#define bit_uint5korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[4])) +\ +(((uint32_t) (((unsigned char*) (A))[3])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[2])) << 16) +\ + (((uint32_t) (((unsigned char*) (A))[1])) << 24)) +\ +(((uint64_t) (((unsigned char*) (A))[0])) << 32)) +#define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[5])) +\ +(((uint32_t) (((unsigned char*) (A))[4])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[3])) << 16) +\ +(((uint32_t) (((unsigned char*) (A))[2])) << 24)) +\ +(((uint64_t) (((uint32_t) (((unsigned char*) (A))[1])) +\ +(((uint32_t) (((unsigned char*) (A))[0]) << 8 <<\ + 32)) +#define bit_uint7korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[6])) +\ +(((uint32_t) (((unsigned char*) (A))[5])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[4])) << 16) +\ + (((uint32_t) (((unsigned char*) (A))[3])) << 24)) +\ +(((uint64_t) (((uint32_t) (((unsigned char*) (A))[2])) +\ +(((uint32_t) (((unsigned char*) (A))[1])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[0])) << 16))) <<\ + 32)) +#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[7])) +\ +(((uint32_t) (((unsigned char*) (A))[6])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[5])) << 16) +\ +(((uint32_t) (((unsigned char*) (A))[4])) << 24)) +\ +(((uint64_t) (((uint32_t) (((unsigned char*) (A))[3])) +\ +(((uint32_t) (((unsigned char*) (A))[2])) << 8) +\ +(((uint32_t) (((unsigned char*) (A))[1])) << 16) +\ +(((uint32_t) (((unsigned char*) (A))[0])) << 24))) <<\ +32)) -#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\ - (((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\ - (((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\ - (((uint32_t) (((zend_uchar*) (A))[0])) << 24))) -#define bit_uint5korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[4])) +\ - (((uint32_t) ((zend_uchar*) (A)[3])) << 8) +\ - (((uint32_t) ((zend_uchar*) (A)[2])) << 16) +\ - (((uint32_t) ((zend_uchar*) (A)[1])) << 24)) +\ - (((uint64_t) ((zend_uchar*) (A)[0])) << 32)) - -#define bit_uint6korr(A) ((ui
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
andrey Wed, 02 Dec 2009 11:58:04 + Revision: http://svn.php.net/viewvc?view=revision&revision=291586 Log: fix macro so that 5-byte BIT values are decoded correctly Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-12-02 10:30:23 UTC (rev 291585) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-12-02 11:58:04 UTC (rev 291586) @@ -247,10 +247,10 @@ (((uint32_t) (((zend_uchar*) (A))[0])) << 24))) #define bit_uint5korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[4])) +\ - (((uint32_t) ((zend_uchar) (A)[3])) << 8) +\ - (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ - (((uint32_t) ((zend_uchar) (A)[1])) << 24)) +\ - (((uint64_t) ((zend_uchar) (A)[0])) << 32)) + (((uint32_t) ((zend_uchar*) (A)[3])) << 8) +\ + (((uint32_t) ((zend_uchar*) (A)[2])) << 16) +\ + (((uint32_t) ((zend_uchar*) (A)[1])) << 24)) +\ + (((uint64_t) ((zend_uchar*) (A)[0])) << 32)) #define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[5])) +\ (((uint32_t) (((zend_uchar*) (A))[4])) << 8) +\ Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2009-12-02 10:30:23 UTC (rev 291585) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2009-12-02 11:58:04 UTC (rev 291586) @@ -247,10 +247,10 @@ (((uint32_t) (((zend_uchar*) (A))[0])) << 24))) #define bit_uint5korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[4])) +\ - (((uint32_t) ((zend_uchar) (A)[3])) << 8) +\ - (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ - (((uint32_t) ((zend_uchar) (A)[1])) << 24)) +\ - (((uint64_t) ((zend_uchar) (A)[0])) << 32)) + (((uint32_t) ((zend_uchar*) (A)[3])) << 8) +\ + (((uint32_t) ((zend_uchar*) (A)[2])) << 16) +\ + (((uint32_t) ((zend_uchar*) (A)[1])) << 24)) +\ + (((uint64_t) ((zend_uchar*) (A)[0])) << 32)) #define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[5])) +\ (((uint32_t) (((zend_uchar*) (A))[4])) << 8) +\ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h trunk/ext/mysqlnd/mysqlnd_portability.h
dmitry Wed, 23 Sep 2009 08:33:23 + Revision: http://svn.php.net/viewvc?view=revision&revision=288603 Log: Fixed compilation error Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-09-23 03:55:46 UTC (rev 288602) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h 2009-09-23 08:33:23 UTC (rev 288603) @@ -9,6 +9,9 @@ were added to improve the header file, to get it more consistent. */ +#ifndef MYSQLND_PORTABILITY_H +#define MYSQLND_PORTABILITY_H + /* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */ #define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) @@ -497,6 +500,7 @@ #endif /* WORDS_BIGENDIAN */ +#endif /* MYSQLND_PORTABILITY_H */ /* Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2009-09-23 03:55:46 UTC (rev 288602) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h 2009-09-23 08:33:23 UTC (rev 288603) @@ -9,6 +9,9 @@ were added to improve the header file, to get it more consistent. */ +#ifndef MYSQLND_PORTABILITY_H +#define MYSQLND_PORTABILITY_H + /* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */ #define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) @@ -497,6 +500,7 @@ #endif /* WORDS_BIGENDIAN */ +#endif /* MYSQLND_PORTABILITY_H */ /* -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php