summaryrefslogtreecommitdiff
path: root/Zend/acconfig.h
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-06-18 16:33:15 +0000
committerSascha Schumann <sas@php.net>2000-06-18 16:33:15 +0000
commit0404a0243012a7fdf201cdf83a37e43c9455e9b6 (patch)
tree2bd247ca55f67413566a462d36dccf7c3a98ee49 /Zend/acconfig.h
parent6e815b76eabaddd4a8e91e2577d6a8d83f7143b4 (diff)
downloadphp-git-0404a0243012a7fdf201cdf83a37e43c9455e9b6.tar.gz
Welcome zend_finite(n).
This chooses the best combination of what is available: finite, isfinite, isinf, isnan
Diffstat (limited to 'Zend/acconfig.h')
-rw-r--r--Zend/acconfig.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/acconfig.h b/Zend/acconfig.h
index 85e52829f1..9b3153daf1 100644
--- a/Zend/acconfig.h
+++ b/Zend/acconfig.h
@@ -35,6 +35,20 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
+#ifdef HAVE_FINITE
+#define zend_finite(a) finite(a)
+#elif defined(HAVE_ISFINITE)
+#define zend_finite(a) isfinite(a)
+#elif defined(HAVE_ISNAN) && defined(HAVE_ISINF)
+#define zend_finite(a) (isnan(a) ? 0 : isinf(a) ? 0 : 1)
+#elif defined(HAVE_ISNAN)
+#define zend_finite(a) (isnan(a) ? 0 : 1)
+#elif defined(HAVE_ISINF)
+#define zend_finite(a) (isinf(a) ? 0 : 1)
+#else
+#define zend_finite(a) (1)
+#endif
+
/*
* Local variables:
* tab-width: 4