1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Building ext/intl fails with MSVC /std:c11 (#17179)

A previous fix to be able to build C++ extensions with MSVC[1], was
based on the assumption that `max_align_t` would be defined in stddef.h
on Windows.  That was plain wrong; there is no such typedef (or macro).

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] <ab449a7e46>
This commit is contained in:
Christoph M. Becker
2025-02-20 15:14:58 +01:00
committed by GitHub
parent c5ee870b85
commit 252dd1e9f0

View File

@@ -789,13 +789,9 @@ extern "C++" {
# define ZEND_STATIC_ASSERT(c, m)
#endif
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */
#if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ \
|| (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */) && !defined(ZEND_WIN32)
typedef max_align_t zend_max_align_t;
#elif (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */
extern "C++" {
# include <cstddef>
}
typedef std::max_align_t zend_max_align_t;
#else
typedef union {
char c;