summaryrefslogtreecommitdiffstats
path: root/src/H5Omtime.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-10-23 14:44:04 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-10-23 14:44:04 (GMT)
commit5c8703895db82fdc0af4e207bc012d46a5a6e77e (patch)
tree4e22188d328c7d391c1306342bacb46402589ed9 /src/H5Omtime.c
parent6ab00dd2a053ebd5e979f255654934c98e35770a (diff)
downloadhdf5-5c8703895db82fdc0af4e207bc012d46a5a6e77e.zip
hdf5-5c8703895db82fdc0af4e207bc012d46a5a6e77e.tar.gz
hdf5-5c8703895db82fdc0af4e207bc012d46a5a6e77e.tar.bz2
[svn-r28202] HDFFV-9550: Add VS2015 fix for timezone.
CMake test fix for VS2015 print exponent
Diffstat (limited to 'src/H5Omtime.c')
-rw-r--r--src/H5Omtime.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 580f642..fdd9a31 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -178,7 +178,13 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
time_t *mesg, the_time;
int i;
struct tm tm;
- void *ret_value; /* Return value */
+ void *ret_value = NULL; /* Return value */
+#if _MSC_VER >= 1900 // VS 2015
+// In gcc and in Visual Studio prior to VS 2015 'timezone' is a global
+// variable declared in time.h. That variable was deprecated and in VS 2015
+// is removed, with _get_timezone replacing it.
+ long timezone = 0;
+#endif
FUNC_ENTER_NOAPI_NOINIT
@@ -219,6 +225,9 @@ H5O_mtime_decode(H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, H5O_t H5
/* BSD-like systems */
the_time += tm.tm_gmtoff;
#elif defined(H5_HAVE_TIMEZONE)
+ #if _MSC_VER >= 1900 // VS 2015
+ HDget_timezone(&timezone);
+ #endif
/* GNU/Linux systems */
the_time -= timezone - (tm.tm_isdst ? 3600 : 0);
#else