Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h trunk/ext/mysqlnd/mysqlnd_structs.h
Hi 2010/9/1 Andrey Hristov and...@php.net: andrey Wed, 01 Sep 2010 16:54:20 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302980 Log: fix build on windows, seems this macro is not defined Wouldn't it be easier to just define SIZEOF_CHAR_P to 4 in config.w32.h.in as it default is? Something like: size_t sizeof_ptr(char *ptr) { return sizeof(ptr); } and test like: char test = Something something; size_t test_size = sizeof_ptr(test); Guess it could be done better or staticlly :) -- regards, Kalle Sommer Nielsen ka...@php.net -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h trunk/ext/mysqlnd/mysqlnd_structs.h
hi Andrey, See http://lxr.php.net/opengrok/xref/PHP_5_3/win32/php_stdint.h it has macros for integer capable to contain a pointer. Cheers, On Wed, Sep 1, 2010 at 6:54 PM, Andrey Hristov and...@php.net wrote: andrey Wed, 01 Sep 2010 16:54:20 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302980 Log: fix build on windows, seems this macro is not defined Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char * unused1; char * unused2; char * unused3; char * unused4; Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char * unused1; char * unused2; char * unused3; char * unused4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h trunk/ext/mysqlnd/mysqlnd_structs.h
I need to keep the ABI. Currently it is char*, which will be 4 bytes on 32bit, and 8 bytes on 64bit. Therefore, I needed this macro to put the right amount of bytes - uint32_t or uint64_t . Anyway, currently this is unused and can stay as char *. I will look for a solution when I needed to use these members. Thanks for the help offered. Andrey Pierre Joye wrote: hi Andrey, See http://lxr.php.net/opengrok/xref/PHP_5_3/win32/php_stdint.h it has macros for integer capable to contain a pointer. Cheers, On Wed, Sep 1, 2010 at 6:54 PM, Andrey Hristov and...@php.net wrote: andrey Wed, 01 Sep 2010 16:54:20 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302980 Log: fix build on windows, seems this macro is not defined Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char* unused1; char* unused2; char* unused3; char* unused4; Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char* unused1; char* unused2; char* unused3; char* unused4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h trunk/ext/mysqlnd/mysqlnd_structs.h
hi, Yes, understood that. I only pointed you to a place where you can get this value per platform/arch tuple on windows. On Wed, Sep 1, 2010 at 10:00 PM, Andrey Hristov p...@hristov.com wrote: I need to keep the ABI. Currently it is char*, which will be 4 bytes on 32bit, and 8 bytes on 64bit. Therefore, I needed this macro to put the right amount of bytes - uint32_t or uint64_t . Anyway, currently this is unused and can stay as char *. I will look for a solution when I needed to use these members. Thanks for the help offered. Andrey Pierre Joye wrote: hi Andrey, See http://lxr.php.net/opengrok/xref/PHP_5_3/win32/php_stdint.h it has macros for integer capable to contain a pointer. Cheers, On Wed, Sep 1, 2010 at 6:54 PM, Andrey Hristov and...@php.net wrote: andrey Wed, 01 Sep 2010 16:54:20 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302980 Log: fix build on windows, seems this macro is not defined Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char * unused1; char * unused2; char * unused3; char * unused4; Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 15:34:48 UTC (rev 302979) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h 2010-09-01 16:54:20 UTC (rev 302980) @@ -156,13 +156,7 @@ The ABI will be broken and the methods structure will be somewhere else in the memory which can crash external code. Feel free to reuse these. */ -#if SIZEOF_CHAR_P == 4 - uint32_t unused1; -#elif SIZEOF_CHAR_P == 8 - uint64_t unused1; -#else -#error Not supported platform -#endif + char * unused1; char * unused2; char * unused3; char * unused4; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php