mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Use C++ symbols, when C++11 or upper is compiled
This commit is contained in:
parent
a4b33f775e
commit
322b97a19a
3 changed files with 28 additions and 6 deletions
|
@ -50,10 +50,16 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
# define zend_sprintf sprintf
|
# define zend_sprintf sprintf
|
||||||
#endif
|
#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>
|
#include <math.h>
|
||||||
|
|
||||||
#ifndef zend_isnan
|
#ifndef zend_isnan
|
||||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISNAN
|
||||||
#define zend_isnan(a) isnan(a)
|
#define zend_isnan(a) isnan(a)
|
||||||
#elif defined(HAVE_FPCLASS)
|
#elif defined(HAVE_FPCLASS)
|
||||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||||
|
@ -62,7 +68,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISINF
|
||||||
#define zend_isinf(a) isinf(a)
|
#define zend_isinf(a) isinf(a)
|
||||||
#elif defined(INFINITY)
|
#elif defined(INFINITY)
|
||||||
/* Might not work, but is required by ISO C99 */
|
/* Might not work, but is required by ISO C99 */
|
||||||
|
@ -73,7 +79,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#define zend_isinf(a) 0
|
#define zend_isinf(a) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISFINITE
|
||||||
#define zend_finite(a) isfinite(a)
|
#define zend_finite(a) isfinite(a)
|
||||||
#elif defined(HAVE_FINITE)
|
#elif defined(HAVE_FINITE)
|
||||||
#define zend_finite(a) finite(a)
|
#define zend_finite(a) finite(a)
|
||||||
|
@ -83,6 +89,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
|
@ -50,9 +50,16 @@ typedef unsigned int uint;
|
||||||
#endif
|
#endif
|
||||||
#define strcasecmp(s1, s2) _stricmp(s1, s2)
|
#define strcasecmp(s1, s2) _stricmp(s1, s2)
|
||||||
#define strncasecmp(s1, s2, n) _strnicmp(s1, s2, n)
|
#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_isinf(a) ((_fpclass(a) == _FPCLASS_PINF) || (_fpclass(a) == _FPCLASS_NINF))
|
||||||
#define zend_finite(x) _finite(x)
|
#define zend_finite(x) _finite(x)
|
||||||
#define zend_isnan(x) _isnan(x)
|
#define zend_isnan(x) _isnan(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define zend_sprintf sprintf
|
#define zend_sprintf sprintf
|
||||||
|
|
||||||
|
|
13
configure.ac
13
configure.ac
|
@ -59,10 +59,16 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
# define zend_sprintf sprintf
|
# define zend_sprintf sprintf
|
||||||
#endif
|
#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>
|
#include <math.h>
|
||||||
|
|
||||||
#ifndef zend_isnan
|
#ifndef zend_isnan
|
||||||
#if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISNAN
|
||||||
#define zend_isnan(a) isnan(a)
|
#define zend_isnan(a) isnan(a)
|
||||||
#elif defined(HAVE_FPCLASS)
|
#elif defined(HAVE_FPCLASS)
|
||||||
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
|
||||||
|
@ -71,7 +77,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISINF
|
||||||
#define zend_isinf(a) isinf(a)
|
#define zend_isinf(a) isinf(a)
|
||||||
#elif defined(INFINITY)
|
#elif defined(INFINITY)
|
||||||
/* Might not work, but is required by ISO C99 */
|
/* Might not work, but is required by ISO C99 */
|
||||||
|
@ -82,7 +88,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#define zend_isinf(a) 0
|
#define zend_isinf(a) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
|
#if HAVE_DECL_ISFINITE
|
||||||
#define zend_finite(a) isfinite(a)
|
#define zend_finite(a) isfinite(a)
|
||||||
#elif defined(HAVE_FINITE)
|
#elif defined(HAVE_FINITE)
|
||||||
#define zend_finite(a) finite(a)
|
#define zend_finite(a) finite(a)
|
||||||
|
@ -92,6 +98,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
|
||||||
|
|
||||||
#undef PTHREADS
|
#undef PTHREADS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue