From: Arthur Bergman Date: Thu, 16 Aug 2001 16:01:54 +0000 (+0200) Subject: *time_r again X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2ed46c510b148e10cfdfa30b4a887b45b5ac877b;p=p5sagit%2Fp5-mst-13.2.git *time_r again Message-ID: <00ca01c1265c$0175f940$21000a0a@vogw2kdev> p4raw-id: //depot/perl@11695 --- diff --git a/op.h b/op.h index e55d546..0b4d555 100644 --- a/op.h +++ b/op.h @@ -464,7 +464,21 @@ struct loop { typedef struct { struct tm* tmbuff; } REBUF; -#define localtime(a) (localtime_r(a,PL_reentrant_buffer->tmbuff) && PL_reentrant_buffer->tmbuff) -#define gmtime(a) (gmtime_r(a,PL_reentrant_buffer->tmbuff) && PL_reentrant_buffer->tmbuff) + +#define localtime(a) (localtime_r(a,PL_reentrant_buffer->tmbuff && PL_reentrant_buffer->tmbuff) +#define gmtime(a) (gmtime_r(a,PL_reentrant_buffer->tmbuff && PL_reentrant_buffer->tmbuff) + +#if defined(__hpux) && defined(__ux_version) && __ux_version <= 1020 + +/* HP-UX 10.20 returns 0 on success, what it returns on failure is hidden + in the fog somewhere, possibly -1 which means the following should do + the right thing - 20010816 sky */ + +#undef localtime +#undef gmtime +#define localtime(a) ((localtime_r(a,PL_reentrant_buffer->tmbuff)+1) && PL_reentrant_buffer->tmbuff) +#define gmtime(a) ((gmtime_r(a,PL_reentrant_buffer->tmbuff)+1) && PL_reentrant_buffer->tmbuff) +#endif /* HP-UX 10.20 */ + #endif