From 6c78e3d5ee77c991e6c945e720cd909586559b66 Mon Sep 17 00:00:00 2001 From: rriggs Date: Thu, 3 Jan 2019 17:39:39 +0800 Subject: [PATCH] 8215976: Fix gmtime_r declaration conflicts in zip.cpp with linux header files Reviewed-by: dholmes, rriggs Contributed-by: patrick@os.amperecomputing.com --- src/share/native/com/sun/java/util/jar/pack/zip.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/share/native/com/sun/java/util/jar/pack/zip.cpp b/src/share/native/com/sun/java/util/jar/pack/zip.cpp index a66fdcdf2..f58c94956 100644 --- a/src/share/native/com/sun/java/util/jar/pack/zip.cpp +++ b/src/share/native/com/sun/java/util/jar/pack/zip.cpp @@ -415,9 +415,11 @@ uLong jar::dostime(int y, int n, int d, int h, int m, int s) { ((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 /* -- GitLab