Skip to content

Commit ba326b6

Browse files
TimWolladevnexen
andcommitted
zend_portability: Support C++ for ZEND_ATTRIBUTE_NODISCARD
Co-authored-by: David CARLIER <[email protected]>
1 parent 3e99869 commit ba326b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_portability.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ char *alloca();
248248
# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
249249
#endif
250250

251-
#if __STDC_VERSION__ >= 202311L
251+
#if __STDC_VERSION__ >= 202311L || (defined(__cplusplus) && __cplusplus >= 201703L)
252252
# define ZEND_ATTRIBUTE_NODISCARD [[nodiscard]]
253253
#elif __has_attribute(__warn_unused_result__)
254254
# define ZEND_ATTRIBUTE_NODISCARD __attribute__((__warn_unused_result__))

0 commit comments

Comments
 (0)