From ab449a7e466570f5700ff91548d2154e9c447a8e Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 24 Jul 2024 21:51:46 +0200 Subject: [PATCH] Add missing cstddef include for C++ builds Closes GH-15096. --- NEWS | 1 + Zend/zend_portability.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index a90c0055ed8..b9753c06aa1 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ PHP NEWS . Fix GH-14978 (The xmlreader extension phpize build). (Peter Kokot) . Throw Error exception when encountering recursion during comparison, rather than fatal error. (ilutov) + . Added missing cstddef include for C++ builds. (cmb) - BCMath: . Adjust bcround()'s $mode parameter to only accept the RoundingMode diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index 24ded1c78d0..5290d7aae4f 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -791,9 +791,13 @@ extern "C++" { # define ZEND_STATIC_ASSERT(c, m) #endif -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ \ - || (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ typedef max_align_t zend_max_align_t; +#elif (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */ +extern "C++" { +# include +} +typedef std::max_align_t zend_max_align_t; #else typedef union { char c;