rrichards               Fri Jul 13 12:50:00 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/date/lib       timelib.c 
  Log:
  MFH: use macro - llabs not always available on win32
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.c?r1=1.7.2.4.2.3&r2=1.7.2.4.2.4&diff_format=u
Index: php-src/ext/date/lib/timelib.c
diff -u php-src/ext/date/lib/timelib.c:1.7.2.4.2.3 
php-src/ext/date/lib/timelib.c:1.7.2.4.2.4
--- php-src/ext/date/lib/timelib.c:1.7.2.4.2.3  Thu Jul 12 18:58:00 2007
+++ php-src/ext/date/lib/timelib.c      Fri Jul 13 12:50:00 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: timelib.c,v 1.7.2.4.2.3 2007/07/12 18:58:00 derick Exp $ */
+/* $Id: timelib.c,v 1.7.2.4.2.4 2007/07/13 12:50:00 rrichards Exp $ */
 
 #include "timelib.h"
 #include <ctype.h>
@@ -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 @@
                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);
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to