diff options
| author | Andrea Faulds <ajf@ajf.me> | 2016-03-20 01:32:44 +0000 |
|---|---|---|
| committer | Andrea Faulds <ajf@ajf.me> | 2016-03-20 01:32:44 +0000 |
| commit | 1c1e20d77160c5ccc402458effa9df56399ca5da (patch) | |
| tree | 63de5ab9a5ecce58c49a13ee62ee92a2615ba445 /ext/intl/common/common_date.cpp | |
| parent | ba4b2a60f932b05c929b843aaf010ac740579e2d (diff) | |
| download | php-git-1c1e20d77160c5ccc402458effa9df56399ca5da.tar.gz | |
Deduplicate NAN/INF portability, move to Zend
Diffstat (limited to 'ext/intl/common/common_date.cpp')
| -rw-r--r-- | ext/intl/common/common_date.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index f1bf75ab0f..2357a03940 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -25,13 +25,7 @@ extern "C" { #include <ext/date/php_date.h> } -#ifndef INFINITY -#define INFINITY (DBL_MAX+DBL_MAX) -#endif - -#ifndef NAN -#define NAN (INFINITY-INFINITY) -#endif +#include "zend_portability.h" /* {{{ timezone_convert_datetimezone * The timezone in DateTime and DateTimeZone is not unified. */ @@ -118,7 +112,7 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, } if (millis) { - *millis = NAN; + *millis = ZEND_NAN; } if (tz) { *tz = NULL; @@ -173,13 +167,13 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err, const char *func) { - double rv = NAN; + double rv = ZEND_NAN; zend_long lv; int type; char *message; if (err && U_FAILURE(err->code)) { - return NAN; + return ZEND_NAN; } switch (Z_TYPE_P(z)) { |
