From 8a8aa67844aa098abf98485329a16171f98b4a1c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 6 Feb 2017 01:45:53 +0100 Subject: [PATCH] Revert "Fix detection of isnan and isinf" This reverts commit 9ea0949f43959ff0cf519e7a10ef9de7a538cde3. --- NEWS | 1 - Zend/Zend.m4 | 3 +-- Zend/configure.in | 14 +++++++------- configure.in | 14 +++++++------- ext/standard/config.m4 | 12 ++++++------ ext/standard/tests/math/bug74039.phpt | 28 --------------------------- 6 files changed, 21 insertions(+), 51 deletions(-) delete mode 100644 ext/standard/tests/math/bug74039.phpt diff --git a/NEWS b/NEWS index 4346259774..adc80db1d3 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,6 @@ PHP NEWS . Fixed bug #73998 (array_key_exists fails on arrays created by get_object_vars). (mhagstrand) . Fixed bug #73954 (NAN check fails on Alpine Linux with musl). (Andrea) - . Fixed bug #74039 (is_infinite(-INF) returns false). (Christian Schmidt) - GD: . Fixed bug #74031 (ReflectionFunction for imagepng is missing last two diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 6ec9ed02e1..bdeac672b4 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -100,8 +100,7 @@ AC_FUNC_ALLOCA AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp) AC_ZEND_BROKEN_SPRINTF -AC_CHECK_FUNCS(finite) -AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include ]]) +AC_CHECK_FUNCS(finite isfinite isinf isnan) ZEND_FP_EXCEPT diff --git a/Zend/configure.in b/Zend/configure.in index 5733b30ce0..3c7915156c 100644 --- a/Zend/configure.in +++ b/Zend/configure.in @@ -64,13 +64,13 @@ int zend_sprintf(char *buffer, const char *format, ...); /* To enable the is_nan, is_infinite and is_finite PHP functions */ #ifdef NETWARE - #define HAVE_DECL_ISNAN 1 - #define HAVE_DECL_ISINF 1 - #define HAVE_DECL_ISINFINITE 1 + #define HAVE_ISNAN 1 + #define HAVE_ISINF 1 + #define HAVE_ISFINITE 1 #endif #ifndef zend_isnan -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) @@ -79,18 +79,18 @@ int zend_sprintf(char *buffer, const char *format, ...); #endif #endif -#ifdef HAVE_DECL_ISINF +#ifdef HAVE_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ -#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0) +#define zend_isinf(a) (((a)==INFINITY)?1:0) #elif defined(HAVE_FPCLASS) #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) #else #define zend_isinf(a) 0 #endif -#if defined(HAVE_DECL_ISINFINITE) || defined(isfinite) +#if defined(HAVE_ISFINITE) || defined(isfinite) #define zend_finite(a) isfinite(a) #elif defined(HAVE_FINITE) #define zend_finite(a) finite(a) diff --git a/configure.in b/configure.in index d2f7567051..b5a3919e5f 100644 --- a/configure.in +++ b/configure.in @@ -69,13 +69,13 @@ int zend_sprintf(char *buffer, const char *format, ...); /* To enable the is_nan, is_infinite and is_finite PHP functions */ #ifdef NETWARE - #define HAVE_DECL_ISNAN 1 - #define HAVE_DECL_ISINF 1 - #define HAVE_DECL_ISINFINITE 1 + #define HAVE_ISNAN 1 + #define HAVE_ISINF 1 + #define HAVE_ISFINITE 1 #endif #ifndef zend_isnan -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) @@ -84,18 +84,18 @@ int zend_sprintf(char *buffer, const char *format, ...); #endif #endif -#ifdef HAVE_DECL_ISINF +#ifdef HAVE_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ -#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0) +#define zend_isinf(a) (((a)==INFINITY)?1:0) #elif defined(HAVE_FPCLASS) #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) #else #define zend_isinf(a) 0 #endif -#if defined(HAVE_DECL_ISINFINITE) || defined(isfinite) +#if defined(HAVE_ISFINITE) || defined(isfinite) #define zend_finite(a) isfinite(a) #elif defined(HAVE_FINITE) #define zend_finite(a) finite(a) diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index ea5ce0626c..ec90af9227 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -420,7 +420,7 @@ AC_TRY_RUN([ #include #include -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) @@ -451,11 +451,11 @@ AC_TRY_RUN([ #include #include -#ifdef HAVE_DECL_ISINF +#ifdef HAVE_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ -#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0) +#define zend_isinf(a) (((a)==INFINITY)?1:0) #elif defined(HAVE_FPCLASS) #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) #else @@ -485,11 +485,11 @@ AC_TRY_RUN([ #include #include -#ifdef HAVE_DECL_ISINF +#ifdef HAVE_ISINF #define zend_isinf(a) isinf(a) #elif defined(INFINITY) /* Might not work, but is required by ISO C99 */ -#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0) +#define zend_isinf(a) (((a)==INFINITY)?1:0) #elif defined(HAVE_FPCLASS) #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF)) #else @@ -520,7 +520,7 @@ AC_TRY_RUN([ #include #include -#ifdef HAVE_DECL_ISNAN +#ifdef HAVE_ISNAN #define zend_isnan(a) isnan(a) #elif defined(HAVE_FPCLASS) #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN)) diff --git a/ext/standard/tests/math/bug74039.phpt b/ext/standard/tests/math/bug74039.phpt deleted file mode 100644 index dd0e1fa260..0000000000 --- a/ext/standard/tests/math/bug74039.phpt +++ /dev/null @@ -1,28 +0,0 @@ ---TEST-- -Bug #74039: is_infinite(-INF) returns false ---FILE-- - ---EXPECT-- -bool(false) -bool(true) -bool(false) -bool(false) -bool(true) -bool(false) -bool(false) -bool(false) -bool(true) -- 2.40.0