From: Rob Richards Date: Fri, 13 Jul 2007 12:50:00 +0000 (+0000) Subject: MFH: use macro - llabs not always available on win32 X-Git-Tag: php-5.2.4RC1~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01fe5a0f225fa88f7c0a3dfe0f7af580a09a227c;p=php MFH: use macro - llabs not always available on win32 --- diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 5179d27e27..6b2fb81327 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -28,6 +28,12 @@ m = NULL; \ } \ +#if defined(_MSC_VER) + #define TIMELIB_LLABS(y) y < 0 ? (y * -1) : y +#else + #define TIMELIB_LLABS(y) llabs(y) +#endif + timelib_time* timelib_time_ctor() { timelib_time *t; @@ -168,7 +174,7 @@ void timelib_dump_date(timelib_time *d, int options) printf("TYPE: %d ", d->zone_type); } printf("TS: %lld | %s%04lld-%02lld-%02lld %02lld:%02lld:%02lld", - d->sse, d->y < 0 ? "-" : "", llabs(d->y), d->m, d->d, d->h, d->i, d->s); + d->sse, d->y < 0 ? "-" : "", TIMELIB_LLABS(d->y), d->m, d->d, d->h, d->i, d->s); if (d->f > +0.0) { printf(" %.5f", d->f); }