Change 11703 by sky@sky-lab on 2001/08/17 07:11:24

        Fixed macros for localtime_r under USE_REENTRANT_API, also fixed for HP-UX 
10.20
        Thanks to Tom Hospel for pointing out my error.

Affected files ...

... //depot/perl/op.h#91 edit

Differences ...

==== //depot/perl/op.h#91 (text) ====
Index: perl/op.h
--- perl/op.h.~1~       Fri Aug 17 01:15:05 2001
+++ perl/op.h   Fri Aug 17 01:15:05 2001
@@ -465,8 +465,8 @@
   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 : NULL)
+#define gmtime(a)          (gmtime_r((a),PL_reentrant_buffer->tmbuff) ?  
+PL_reentrant_buffer->tmbuff : NULL)
 
 #if defined(__hpux) && defined(__ux_version) && __ux_version <= 1020
 
@@ -476,8 +476,8 @@
 
 #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)
+#define localtime(a)       ((localtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? 
+PL_reentrant_buffer->tmbuff : NULL)
+#define gmtime(a)          ((gmtime_r((a),PL_reentrant_buffer->tmbuff) == 0) ? 
+PL_reentrant_buffer->tmbuff : NULL)
 #endif /* HP-UX 10.20 */
 
 #endif
End of Patch.

Reply via email to