changeset 13434:db7a698be165

8215976: Fix gmtime_r declaration conflicts in zip.cpp with linux header files Reviewed-by: dholmes, rriggs Contributed-by: patrick@os.amperecomputing.com
author rriggs
date Thu, 03 Jan 2019 17:39:39 +0800
parents c0c5709fe992
children 00475cd329f7
files src/share/native/com/sun/java/util/jar/pack/zip.cpp
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Thu Jan 03 12:14:48 2019 +0100
+++ b/src/share/native/com/sun/java/util/jar/pack/zip.cpp	Thu Jan 03 17:39:39 2019 +0800
@@ -415,9 +415,11 @@
     ((uLong)h << 11) | ((uLong)m << 5) | ((uLong)s >> 1);
 }
 
-#ifdef _REENTRANT // solaris
-extern "C" struct tm *gmtime_r(const time_t *, struct tm *);
-#else
+/*
+ * For thread-safe reasons, non-Windows platforms need gmtime_r
+ * while Windows can directly use gmtime that is already thread-safe.
+ */
+#ifdef _MSC_VER
 #define gmtime_r(t, s) gmtime(t)
 #endif
 /*