From: Karsten Blees <karsten.blees@gmail.com>
To: Git List <git@vger.kernel.org>, msysGit <msysgit@googlegroups.com>
Cc: Karsten Blees <karsten.blees@gmail.com>
Subject: [PATCH 1/3] Win32: make FILETIME conversion functions public
Date: Thu, 12 Feb 2015 00:51:09 +0100 [thread overview]
Message-ID: <54DBEAED.5030201@gmail.com> (raw)
In-Reply-To: <54DBEAA5.6000205@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
---
compat/mingw.c | 16 ----------------
compat/mingw.h | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 70f3191..ba3cfb0 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -419,22 +419,6 @@ int mingw_chmod(const char *filename, int mode)
return _wchmod(wfilename, mode);
}
-/*
- * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
- * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
- */
-static inline long long filetime_to_hnsec(const FILETIME *ft)
-{
- long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime;
- /* Windows to Unix Epoch conversion */
- return winTime - 116444736000000000LL;
-}
-
-static inline time_t filetime_to_time_t(const FILETIME *ft)
-{
- return (time_t)(filetime_to_hnsec(ft) / 10000000);
-}
-
/* We keep the do_lstat code in a separate function to avoid recursion.
* When a path ends with a slash, the stat will fail with ENOENT. In
* this case, we strip the trailing slashes and stat again.
diff --git a/compat/mingw.h b/compat/mingw.h
index 5e499cf..f2a78b4 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -283,6 +283,22 @@ static inline int getrlimit(int resource, struct rlimit *rlp)
}
/*
+ * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC.
+ * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch.
+ */
+static inline long long filetime_to_hnsec(const FILETIME *ft)
+{
+ long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime;
+ /* Windows to Unix Epoch conversion */
+ return winTime - 116444736000000000LL;
+}
+
+static inline time_t filetime_to_time_t(const FILETIME *ft)
+{
+ return (time_t)(filetime_to_hnsec(ft) / 10000000);
+}
+
+/*
* Use mingw specific stat()/lstat()/fstat() implementations on Windows.
*/
#define off_t off64_t
--
2.3.0.3.ge7778af
--
--
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.
You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en
---
You received this message because you are subscribed to the Google Groups "Git for Windows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2015-02-11 23:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 23:49 [PATCH 0/3] Win32: nanosecond-precision file times Karsten Blees
2015-02-11 23:51 ` Karsten Blees [this message]
2015-02-11 23:52 ` [PATCH 2/3] Win32: replace MSVCRT's fstat() with a Win32-based implementation Karsten Blees
2015-02-11 23:53 ` [PATCH 3/3] Win32: implement nanosecond-precision file times Karsten Blees
2015-02-12 23:15 ` Thomas Braun
2015-02-12 23:44 ` Karsten Blees
2015-02-12 19:48 ` [PATCH 0/3] Win32: " Junio C Hamano
2015-02-12 22:30 ` Johannes Schindelin
2015-02-12 22:57 ` Karsten Blees
2015-02-12 23:38 ` Junio C Hamano
2015-02-13 1:59 ` Karsten Blees
2015-02-13 19:28 ` Junio C Hamano
2015-02-16 20:18 ` Karsten Blees
2015-02-16 22:10 ` Junio C Hamano
2015-02-17 21:57 ` Karsten Blees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54DBEAED.5030201@gmail.com \
--to=karsten.blees@gmail.com \
--cc=git@vger.kernel.org \
--cc=msysgit@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).