ARM assembly pack: make it Windows-friendly.
[openssl.git] / crypto / o_time.c
index 369023250545d79c2c5072ba7ccba348ef1c6db6..f0e3e472e000528a7be1a14ec109dbb71db81eb7 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
@@ -20,7 +20,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
         /*
          * On VMS, gmtime_r() takes a 32-bit pointer as second argument.
          * Since we can't know that |result| is in a space that can easily
-         * translate to a 32-bit pointer, we must store temporarly on stack
+         * translate to a 32-bit pointer, we must store temporarily on stack
          * and copy the result.  The stack is always reachable with 32-bit
          * pointers.
          */
@@ -41,6 +41,10 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
     if (gmtime_r(timer, result) == NULL)
         return NULL;
     ts = result;
+#elif defined (OPENSSL_SYS_WINDOWS) && defined(_MSC_VER) && _MSC_VER >= 1400
+    if (gmtime_s(result, timer))
+        return NULL;
+    ts = result;
 #else
     ts = gmtime(timer);
     if (ts == NULL)