summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Omtime.c11
-rw-r--r--src/H5win32defs.h8
2 files changed, 17 insertions, 2 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
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 185e9b4..58e1412 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -84,7 +84,13 @@ struct timezone {
#define HDgetlogin() Wgetlogin()
#define HDsnprintf c99_snprintf /*varargs*/
#define HDvsnprintf c99_vsnprintf
-
+#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.
+ #define HDget_timezone(V) _get_timezone(V);
+#endif
+
#endif /* H5_HAVE_VISUAL_STUDIO */
/* Non-POSIX functions */