Skip to content

Commit be09985

Browse files
psumberadevnexen
authored andcommitted
Fix GH-19169: ZEND_STATIC_ASSERT for -std=c++17
needs to define ZEND_STATIC_ASSERT to appropriate C++ static_assert instead of the C version.
1 parent 86aaded commit be09985

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.3.25
44

5+
- Core:
6+
. Fixed GH-19169 build issue with C++17 and ZEND_STATIC_ASSERT macro.
7+
(psumbera)
8+
59
- Hash:
610
. Fix crash on clone failure. (nielsdos)
711

Zend/zend_portability.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,9 @@ extern "C++" {
761761
/** @deprecated */
762762
#define ZEND_CGG_DIAGNOSTIC_IGNORED_END ZEND_DIAGNOSTIC_IGNORED_END
763763

764-
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
764+
#if defined(__cplusplus)
765+
# define ZEND_STATIC_ASSERT(c, m) static_assert((c), m)
766+
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
765767
# define ZEND_STATIC_ASSERT(c, m) _Static_assert((c), m)
766768
#else
767769
# define ZEND_STATIC_ASSERT(c, m)

0 commit comments

Comments
 (0)