Use one place to define max length of double

Introduce new constant PHP_DOUBLE_MAX_LENGTH for that purpose
This commit is contained in:
Jakub Zelenka 2016-06-26 14:03:01 +01:00
parent 158b537c99
commit 3f13507dd2
5 changed files with 14 additions and 37 deletions

View file

@ -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