Skip to content

Commit 1c4ad17

Browse files
committed
Move isinf, isnan, and isfinite to zend_portability.h
Closes GH-4966
1 parent f03d311 commit 1c4ad17

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

Zend/zend_portability.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,20 @@ char *alloca();
442442

443443
#define ZEND_NAN NAN
444444

445+
#if defined(__cplusplus) && __cplusplus >= 201103L
446+
extern "C++" {
447+
# include <cmath>
448+
}
449+
# define zend_isnan std::isnan
450+
# define zend_isinf std::isinf
451+
# define zend_finite std::isfinite
452+
#else
453+
# include <math.h>
454+
# define zend_isnan(a) isnan(a)
455+
# define zend_isinf(a) isinf(a)
456+
# define zend_finite(a) isfinite(a)
457+
#endif
458+
445459
#define ZEND_STRL(str) (str), (sizeof(str)-1)
446460
#define ZEND_STRS(str) (str), (sizeof(str))
447461
#define ZEND_NORMALIZE_BOOL(n) \

configure.ac

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,6 @@ AH_BOTTOM([
6161
6262
#include <string.h>
6363
64-
#if defined(__cplusplus) && __cplusplus >= 201103L
65-
extern "C++" {
66-
#include <cmath>
67-
#define zend_isnan std::isnan
68-
#define zend_isinf std::isinf
69-
#define zend_finite std::isfinite
70-
}
71-
#else
72-
#include <math.h>
73-
74-
#define zend_isnan(a) isnan(a)
75-
#define zend_isinf(a) isinf(a)
76-
#define zend_finite(a) isfinite(a)
77-
78-
#endif
7964
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
8065
8166
#endif /* PHP_CONFIG_H */

0 commit comments

Comments
 (0)