summaryrefslogtreecommitdiff
path: root/main/php.h
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-06-26 14:03:01 +0100
committerJakub Zelenka <bukka@php.net>2016-06-26 14:03:01 +0100
commit3f13507dd281adf0518c9162dce5391e9250e93b (patch)
tree70f4addc37de995e1a58e5baec180e0ef266a937 /main/php.h
parent158b537c99ca5fc7846e7d16d532644be95894a7 (diff)
downloadphp-git-3f13507dd281adf0518c9162dce5391e9250e93b.tar.gz
Use one place to define max length of double
Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose
Diffstat (limited to 'main/php.h')
-rw-r--r--main/php.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/main/php.h b/main/php.h
index 8eb1c53e8b..8cc7851016 100644
--- a/main/php.h
+++ b/main/php.h
@@ -231,6 +231,14 @@ char *strerror(int);
#define INT_MIN (- INT_MAX - 1)
#endif
+/* double limits */
+#include <float.h>
+#if defined(DBL_MANT_DIG) && defined(DBL_MIN_EXP)
+#define PHP_DOUBLE_MAX_LENGTH (3 + DBL_MANT_DIG - DBL_MIN_EXP)
+#else
+#define PHP_DOUBLE_MAX_LENGTH 1080
+#endif
+
#define PHP_GCC_VERSION ZEND_GCC_VERSION
#define PHP_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_MALLOC
#define PHP_ATTRIBUTE_FORMAT ZEND_ATTRIBUTE_FORMAT