C++ Extensions
| From: | Sara Golemon | Date: | Wed, 19 Aug 2015 19:55:18 +0000 |
| Subject: | C++ Extensions | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-87814@lists.php.net to get a copy of this message | ||
PHP7's 64bit support in Zend/zend_long.h uses INT64_MIN/MAX as well as
INT64_C/INT32_C concat macros.
In C++, these are only defined if __STDC_LIMIT_MACROS and
__STDC_CONSTANT_MACROS has been set prior to including stdint.h
A C++ extension developer could deal with this by defining those prior
to including php.h, but I wonder if we should accommodate by either:
A) Adding those defines prior to including stdint.h
B) Expecting C++ ext devs to define those before including php.h
C) Modifying zend_long.h to use things like
std::numeric_limits<int64_t>() when __cplusplus is defined
A may (potentially) have unexpected side-effects
B has precedent (see ext/intl/config.m4)
C makes the ifdef block that's already there notably more complex
-Sara