Skip to content

Commit ab449a7

Browse files
committed
Add missing cstddef include for C++ builds
Closes phpGH-15096.
1 parent ad45208 commit ab449a7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PHP NEWS
66
. Fix GH-14978 (The xmlreader extension phpize build). (Peter Kokot)
77
. Throw Error exception when encountering recursion during comparison, rather
88
than fatal error. (ilutov)
9+
. Added missing cstddef include for C++ builds. (cmb)
910

1011
- BCMath:
1112
. Adjust bcround()'s $mode parameter to only accept the RoundingMode

Zend/zend_portability.h

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

794-
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */ \
795-
|| (defined(__cplusplus) && __cplusplus >= 201103L) /* C++11 */
794+
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 */
796795
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;
797801
#else
798802
typedef union {
799803
char c;

0 commit comments

Comments
 (0)