com php-src: Revert "Use C++ symbols, when C++11 or upper is compiled": Zend/configure.ac Zend/zend_config.w32.h configure .ac
| From: | Anatol Belski | Date: | Thu, 18 Oct 2018 21:36:46 +0000 |
| Subject: | com php-src: Revert "Use C++ symbols, when C++11 or upper is compiled": Zend/configure.ac Zend/zend_config.w32.h configure .ac | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103504@lists.php.net to get a copy of this message | ||
Commit: f5bc049136f86b0e0613f4b92e86cd41457aedc9
Author: Anatol Belski <ab@php.net> Thu, 18 Oct 2018 23:36:46 +0200
Parents: 322b97a19a3a06d7d66e6f74b4dc071384badf64
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f5bc049136f86b0e0613f4b92e86cd41457aedc9
Log:
Revert "Use C++ symbols, when C++11 or upper is compiled"
This reverts commit 322b97a19a3a06d7d66e6f74b4dc071384badf64.
GCC 5 vs. 8 seems to be a big deal in this regard. The approach needs
further consideration.
Changed paths:
M Zend/configure.ac
M Zend/zend_config.w32.h
M configure.ac
Diff:
diff --git a/Zend/configure.ac b/Zend/configure.ac
index 694ecbc..8252cfb 100644
--- a/Zend/configure.ac
+++ b/Zend/configure.ac
@@ -50,16 +50,10 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
-#if defined(__cplusplus) && __cplusplus >= 201103L
-#include <cmath>
-#define zend_isnan std::isnan
-#define zend_isinf std::isinf
-#define zend_finite std::isfinite
-#else
#include <math.h>
#ifndef zend_isnan
-#if HAVE_DECL_ISNAN
+#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -68,7 +62,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif
#endif
-#if HAVE_DECL_ISINF
+#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -79,7 +73,7 @@ int zend_sprintf(char *buffer, const char *format, ....);
#define zend_isinf(a) 0
#endif
-#if HAVE_DECL_ISFINITE
+#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -89,8 +83,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
-#endif
-
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
])
diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h
index 37442ff..71d550e 100644
--- a/Zend/zend_config.w32.h
+++ b/Zend/zend_config.w32.h
@@ -50,16 +50,9 @@ typedef unsigned int uint;
#endif
#define strcasecmp(s1, s2) _stricmp(s1, s2)
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
-#if defined(__cplusplus) && __cplusplus >= 201103L
-#include <cmath>
-#define zend_isnan std::isnan
-#define zend_isinf std::isinf
-#define zend_finite std::isfinite
-#else
#define zend_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))
#define zend_finite(x) _finite(x)
#define zend_isnan(x) _isnan(x)
-#endif
#define zend_sprintf sprintf
diff --git a/configure.ac b/configure.ac
index bd9a065..09cb270 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,16 +59,10 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
-#if defined(__cplusplus) && __cplusplus >= 201103L
-#include <cmath>
-#define zend_isnan std::isnan
-#define zend_isinf std::isinf
-#define zend_finite std::isfinite
-#else
#include <math.h>
#ifndef zend_isnan
-#if HAVE_DECL_ISNAN
+#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
@@ -77,7 +71,7 @@ int zend_sprintf(char *buffer, const char *format, ....);
#endif
#endif
-#if HAVE_DECL_ISINF
+#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
@@ -88,7 +82,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isinf(a) 0
#endif
-#if HAVE_DECL_ISFINITE
+#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -98,7 +92,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
#endif
-#endif
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#undef PTHREADS