Bug 1406736 Match MinGW's macro so we declare gmtime_r under MinGW too r?froydnj draft
authorTom Ritter <tom@mozilla.com>
Mon, 09 Oct 2017 00:18:19 -0500
changeset 676621 ed0812dc8a42b57180948a9629bdc4ee2056b5bc
parent 676512 bde987c925d5aba9dfd0820afa116e7b2bf0456d
child 734985 ea0294bc0a45f758ace5619de11bcbe16f9522fa
push id83549
push userbmo:tom@mozilla.com
push dateMon, 09 Oct 2017 05:19:31 +0000
reviewersfroydnj
bugs1406736
milestone58.0a1
Bug 1406736 Match MinGW's macro so we declare gmtime_r under MinGW too r?froydnj MozReview-Commit-ID: 2U2ToeyVUUt
security/pkix/test/lib/pkixtestutil.cpp
old mode 100644
new mode 100755
--- a/security/pkix/test/lib/pkixtestutil.cpp
+++ b/security/pkix/test/lib/pkixtestutil.cpp
@@ -244,17 +244,17 @@ Integer(long value)
   ByteString encodedValue;
   encodedValue.push_back(static_cast<uint8_t>(value));
   return TLV(der::INTEGER, encodedValue);
 }
 
 enum TimeEncoding { UTCTime = 0, GeneralizedTime = 1 };
 
 // Windows doesn't provide gmtime_r, but it provides something very similar.
-#if defined(WIN32) && !defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+#if defined(WIN32) && (!defined(_POSIX_C_SOURCE) || !defined(_POSIX_THREAD_SAFE_FUNCTIONS))
 static tm*
 gmtime_r(const time_t* t, /*out*/ tm* exploded)
 {
   if (gmtime_s(exploded, t) != 0) {
     return nullptr;
   }
   return exploded;
 }