From 3ecdafbde86fc01cd3f37c9327497ed0da8ab743 Mon Sep 17 00:00:00 2001
From: mikehoyle <mikehoyle@google.com>
Date: Thu, 24 Oct 2019 13:59:53 -0700
Subject: [PATCH] Updating for formatting _time64, and gnu test failures

---
 src/windows/mod.rs  | 12 +++++++-----
 src/windows/msvc.rs |  4 ++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/windows/mod.rs b/src/windows/mod.rs
index 9dafb43a..a83babae 100644
--- a/src/windows/mod.rs
+++ b/src/windows/mod.rs
@@ -215,7 +215,6 @@ pub const ENOTRECOVERABLE: ::c_int = 127;
 pub const ENOTSOCK: ::c_int = 128;
 pub const ENOTSUP: ::c_int = 129;
 pub const EOPNOTSUPP: ::c_int = 130;
-pub const EOTHER: ::c_int = 131;
 pub const EOVERFLOW: ::c_int = 132;
 pub const EOWNERDEAD: ::c_int = 133;
 pub const EPROTO: ::c_int = 134;
@@ -378,8 +377,6 @@ extern "C" {
         n: size_t,
     ) -> ::size_t;
 
-    pub fn time(destTime: *mut time_t) -> time_t;
-
     pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
     pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int;
     pub fn memcpy(
@@ -403,6 +400,8 @@ extern "C" {
     pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t;
     pub fn raise(signum: c_int) -> c_int;
 
+    #[link_name = "_time64"]
+    pub fn time(destTime: *mut time_t) -> time_t;
     #[link_name = "_chmod"]
     pub fn chmod(path: *const c_char, mode: ::c_int) -> ::c_int;
     #[link_name = "_wchmod"]
@@ -471,8 +470,11 @@ extern "C" {
     #[link_name = "_lseek"]
     pub fn lseek(fd: ::c_int, offset: c_long, origin: ::c_int) -> c_long;
     #[link_name = "_lseeki64"]
-    pub fn lseek64(fd: ::c_int, offset: c_longlong, origin: ::c_int)
-        -> c_longlong;
+    pub fn lseek64(
+        fd: ::c_int,
+        offset: c_longlong,
+        origin: ::c_int,
+    ) -> c_longlong;
     #[link_name = "_pipe"]
     pub fn pipe(
         fds: *mut ::c_int,
diff --git a/src/windows/msvc.rs b/src/windows/msvc.rs
index 27333ae2..8f20deb5 100644
--- a/src/windows/msvc.rs
+++ b/src/windows/msvc.rs
@@ -1,6 +1,10 @@
 pub const L_tmpnam: ::c_uint = 260;
 pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
 
+// POSIX Supplement (from errno.h)
+// This particular error code is only currently available in msvc toolchain
+pub const EOTHER: ::c_int = 131;
+
 extern "C" {
     #[link_name = "_stricmp"]
     pub fn stricmp(s1: *const ::c_char, s2: *const ::c_char) -> ::c_int;
-- 
GitLab