Skip to content

Commit f5bc049

Browse files
committed
Revert "Use C++ symbols, when C++11 or upper is compiled"
This reverts commit 322b97a. GCC 5 vs. 8 seems to be a big deal in this regard. The approach needs further consideration.
1 parent 322b97a commit f5bc049

File tree

3 files changed

+6
-28
lines changed

3 files changed

+6
-28
lines changed

Zend/configure.ac

+3-11
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,10 @@ int zend_sprintf(char *buffer, const char *format, ...);
5050
# define zend_sprintf sprintf
5151
#endif
5252
53-
#if defined(__cplusplus) && __cplusplus >= 201103L
54-
#include <cmath>
55-
#define zend_isnan std::isnan
56-
#define zend_isinf std::isinf
57-
#define zend_finite std::isfinite
58-
#else
5953
#include <math.h>
6054
6155
#ifndef zend_isnan
62-
#if HAVE_DECL_ISNAN
56+
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
6357
#define zend_isnan(a) isnan(a)
6458
#elif defined(HAVE_FPCLASS)
6559
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -68,7 +62,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
6862
#endif
6963
#endif
7064
71-
#if HAVE_DECL_ISINF
65+
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
7266
#define zend_isinf(a) isinf(a)
7367
#elif defined(INFINITY)
7468
/* Might not work, but is required by ISO C99 */
@@ -79,7 +73,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
7973
#define zend_isinf(a) 0
8074
#endif
8175
82-
#if HAVE_DECL_ISFINITE
76+
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
8377
#define zend_finite(a) isfinite(a)
8478
#elif defined(HAVE_FINITE)
8579
#define zend_finite(a) finite(a)
@@ -89,8 +83,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
8983
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
9084
#endif
9185
92-
#endif
93-
9486
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
9587
9688
])

Zend/zend_config.w32.h

-7
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,9 @@ typedef unsigned int uint;
5050
#endif
5151
#define strcasecmp(s1, s2) _stricmp(s1, s2)
5252
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
53-
#if defined(__cplusplus) && __cplusplus >= 201103L
54-
#include <cmath>
55-
#define zend_isnan std::isnan
56-
#define zend_isinf std::isinf
57-
#define zend_finite std::isfinite
58-
#else
5953
#define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))
6054
#define zend_finite(x) _finite(x)
6155
#define zend_isnan(x) _isnan(x)
62-
#endif
6356

6457
#define zend_sprintf sprintf
6558

configure.ac

+3-10
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,10 @@ int zend_sprintf(char *buffer, const char *format, ...);
5959
# define zend_sprintf sprintf
6060
#endif
6161
62-
#if defined(__cplusplus) && __cplusplus >= 201103L
63-
#include <cmath>
64-
#define zend_isnan std::isnan
65-
#define zend_isinf std::isinf
66-
#define zend_finite std::isfinite
67-
#else
6862
#include <math.h>
6963
7064
#ifndef zend_isnan
71-
#if HAVE_DECL_ISNAN
65+
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
7266
#define zend_isnan(a) isnan(a)
7367
#elif defined(HAVE_FPCLASS)
7468
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -77,7 +71,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
7771
#endif
7872
#endif
7973
80-
#if HAVE_DECL_ISINF
74+
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
8175
#define zend_isinf(a) isinf(a)
8276
#elif defined(INFINITY)
8377
/* Might not work, but is required by ISO C99 */
@@ -88,7 +82,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
8882
#define zend_isinf(a) 0
8983
#endif
9084
91-
#if HAVE_DECL_ISFINITE
85+
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
9286
#define zend_finite(a) isfinite(a)
9387
#elif defined(HAVE_FINITE)
9488
#define zend_finite(a) finite(a)
@@ -98,7 +92,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
9892
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
9993
#endif
10094
101-
#endif
10295
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
10396
10497
#undef PTHREADS

0 commit comments

Comments
 (0)