The exact error message is system-dependent.
[p5sagit/p5-mst-13.2.git] / op.h
diff --git a/op.h b/op.h
index 0b4d555..3158395 100644 (file)
--- a/op.h
+++ b/op.h
@@ -23,7 +23,7 @@
  *                     which may or may not check number of children).
  */
 
-typedef U32 PADOFFSET;
+typedef UV PADOFFSET;
 #define NOT_IN_PAD ((PADOFFSET) -1)
 
 #ifdef DEBUGGING_OPS
@@ -461,12 +461,13 @@ struct loop {
 #define PERL_LOADMOD_IMPORT_OPS                0x4
 
 #ifdef USE_REENTRANT_API
+
 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 : 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 +477,8 @@ typedef struct {
 
 #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