summaryrefslogtreecommitdiff
path: root/ext/date/lib/timelib.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2007-07-13 12:50:00 (GMT)
committerRob Richards <rrichards@php.net>2007-07-13 12:50:00 (GMT)
commit01fe5a0f225fa88f7c0a3dfe0f7af580a09a227c (patch)
tree3f65be60dc1272fca5bbf689d3db915ec046844c /ext/date/lib/timelib.c
parent06877d0064a6e329ca5ee3e6bdb8100c41a5725f (diff)
downloadphp-01fe5a0f225fa88f7c0a3dfe0f7af580a09a227c.tar.gz
MFH: use macro - llabs not always available on win32
Diffstat (limited to 'ext/date/lib/timelib.c')
-rw-r--r--ext/date/lib/timelib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 5179d27..6b2fb81 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);
}