Skip to content

Commit 252dd1e

Browse files
authored
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] <ab449a7>
1 parent c5ee870 commit 252dd1e

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
@@ -789,13 +789,9 @@ extern "C++" {
789789
# define ZEND_STATIC_ASSERT(c, m)
790790
#endif
791791

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

0 commit comments

Comments
 (0)