summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-03-06 14:03:02 +0100
committerAndy Polyakov <appro@openssl.org>2014-03-06 14:07:16 +0100
commit25ebd9e3ce443adbb6d35dd921e0e7fc030900df (patch)
treef9cc62572398bab4ab117cca82f4faee75fa1370
parentbdfc0e284c89dd5781259cc19aa264aded538492 (diff)
downloadopenssl-new-25ebd9e3ce443adbb6d35dd921e0e7fc030900df.tar.gz
bss_dgram.c,d1_lib.c: make it compile with mingw.
Submitted by: Roumen Petrov (cherry picked from commit 972b0dc3500a26edb178a5446a0cdfb8f450f853)
-rw-r--r--crypto/bio/bss_dgram.c4
-rw-r--r--ssl/d1_lib.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index 6912aa1278..ec33423d7f 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -1901,7 +1901,11 @@ static void get_current_time(struct timeval *t)
GetSystemTime(&st);
SystemTimeToFileTime(&st,&now.ft);
+#ifdef __MINGW32__
+ now.ul -= 116444736000000000ULL;
+#else
now.ul -= 116444736000000000UI64; /* re-bias to 1/1/1970 */
+#endif
t->tv_sec = (long)(now.ul/10000000);
t->tv_usec = ((int)(now.ul%10000000))/10;
#elif defined(OPENSSL_SYS_VMS)
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 2b066e0165..2287ba6fa4 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -487,7 +487,11 @@ static void get_current_time(struct timeval *t)
GetSystemTime(&st);
SystemTimeToFileTime(&st,&now.ft);
+#ifdef __MINGW32__
+ now.ul -= 116444736000000000ULL;
+#else
now.ul -= 116444736000000000UI64; /* re-bias to 1/1/1970 */
+#endif
t->tv_sec = (long)(now.ul/10000000);
t->tv_usec = ((int)(now.ul%10000000))/10;
#elif defined(OPENSSL_SYS_VMS)