Hi Jan,

On Mon, February 2, 2015 00:42, Jan Ehrhardt wrote:
> Jan Ehrhardt in php.pecl.dev (Sun, 01 Feb 2015 23:38:00 +0100):
>
>> "PECL Announce" in php.pecl.dev (1 Feb 2015 20:13:00 -0000):
>>
>>> - PHP7 compatibility
>>>
>>
>> To make this compile with PHP7 I had to add __STDC_CONSTANT_MACROS in
>> php_xmldiff.h
>>
>> #define __STDC_LIMIT_MACROS 1
>> +#define __STDC_CONSTANT_MACROS 1
>>
>>
>> #include "php.h"
>> #include "php_ini.h"
>>
>>
>> Otherwise I am getting all undefined errors for INT32_C, UINT64_C and
>> the like.
>
> Ok, I see you were getting the same errors on x86:
> http://windows.php.net/downloads/pecl/snaps/xmldiff/1.1.0/logs/php_xmldiff
>  -1.1.0-7.0-nts-vc11-x86-logs.zip
>
>
> Just wondering: if any ext (for instance dom or xml) loads php_stdint.h
> before xmldiff, but without setting __STDC_CONSTANT_MACROS, INT32_C will
> not be defined. At the moment the compiler starts with xmldiff,
> PHP_STDINT_H will
> already be defined and main/php_stdint.h will not load win32/php_stdint.h
> once again. So INT32_C will remain undefined.
>
> Wouldn't it be better to include win32/php_stdint.h directly in
> php_xmldiff.h if you are compiling for Windows?
>
thanks for checking. You've done it absolutely right, I've also found out
why it did pass on 64 bit - stdint wasn't used there for int constant
macro (fixed in master now, should be equally failing in this case). as
it's a pure C++ issue, see
http://lxr.php.net/xref/PHP_TRUNK/win32/php_stdint.h#229 which implements
the spec.

The __STDC_* macros have to be used in C++, maybe we even should enable
them by default. Header inclusion in the other files shouldn't do any side
effect. It only can be messed up by inclusion order is some in some
concrete case, but it's always a local thing. That's why those macros
should be always defined before any PHP headers was included.

Regards

Anatol

Regards

Anatol

-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to