[tz] [PROPOSED PATCH 1/2] Support -Dtime_tz=time_t

Paul Eggert eggert at cs.ucla.edu
Wed Mar 11 03:55:52 UTC 2015


* private.h (tz_time_t), NEWS: Move typedef earlier.
(Problem reported by Bradley White.)
---
 NEWS      | 2 ++
 private.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 1e74bfd..89b5349 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,8 @@ Unreleased, experimental changes
     Fix integer overflow bug in reference 'mktime' implementation.
     (Problem reported by Jörg Richter.)
 
+    Allow -Dtime_tz=time_t compilations.  (Problem reported by Bradley White.)
+
   Changes affecting commentary
 
     Cite the recent Mexican decree changing Quintana Roo's time zone.
diff --git a/private.h b/private.h
index efa1bdf..b9429ae 100644
--- a/private.h
+++ b/private.h
@@ -308,6 +308,8 @@ typedef unsigned long uintmax_t;
 static time_t sys_time(time_t *x) { return time(x); }
 # endif
 
+typedef time_tz tz_time_t;
+
 # undef  ctime
 # define ctime tz_ctime
 # undef  ctime_r
@@ -341,8 +343,6 @@ static time_t sys_time(time_t *x) { return time(x); }
 # undef  timeoff
 # define timeoff tz_timeoff
 
-typedef time_tz time_t;
-
 char *ctime(time_t const *);
 char *ctime_r(time_t const *, char *);
 double difftime(time_t, time_t);
-- 
2.1.0



More information about the tz mailing list