Mercurial > octave-nkf
changeset 13984:1126c2907878
avoid accessing tm_gmtoff from struct tm unless it is present
* oct-time.cc (octave_time::octave_time): Don't attempt to access
t.tm_gmtoff unless HAVE_STRUCT_TM_GMTOFF is defined.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 03 Dec 2011 05:23:52 -0500 |
parents | 7dd7cccf0757 |
children | 43cc49c7abd1 |
files | liboctave/oct-time.cc |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/oct-time.cc Sat Dec 03 04:34:17 2011 -0500 +++ b/liboctave/oct-time.cc Sat Dec 03 05:23:52 2011 -0500 @@ -53,7 +53,10 @@ t.tm_wday = tm.wday (); t.tm_yday = tm.yday (); t.tm_isdst = tm.isdst (); + +#if defined (HAVE_STRUCT_TM_GMTOFF) t.tm_gmtoff = tm.gmtoff (); +#endif #if defined (HAVE_STRUCT_TM_TM_ZONE) std::string s = tm.zone ();