Skip to content

Commit dab2a64

Browse files
committed
Fix GH-17107: Building ext/intl fails with GCC 8.5.0
A previous fix to be able to build C++ extensions with MSVC[1], was based on two assumptions: * `max_align_t` would be defined in stddef.h on Windows * additionally including cstddef as extern C++ would not interfere with the already included stddef.h The former was plain wrong; there is no such typedef (or macro); the latter was presumptuous, as can be seen in the bug tracker ticket. Thus we revert that fix, and instead make an exception for Windows, where we always use the fallback definition, which should work fine on Windows. [1] <ab449a7>
1 parent 52ebdfb commit dab2a64

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Zend/zend_portability.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -791,13 +791,9 @@ extern "C++" {
791791
# define ZEND_STATIC_ASSERT(c, m)
792792
#endif
793793

794-
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */
794+
#if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ \
795+
|| (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */) && !defined(ZEND_WIN32)
795796
typedef max_align_t zend_max_align_t;
796-
#elif (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */
797-
extern "C++" {
798-
# include <cstddef>
799-
}
800-
typedef std::max_align_t zend_max_align_t;
801797
#else
802798
typedef union {
803799
char c;

0 commit comments

Comments
 (0)