From 5bae6946c6444e863bd025f546fd90194855a1aa Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Wed, 8 May 2019 16:05:37 +0200
Subject: [PATCH] time/FileTime: add ToUint64(FILETIME)

---
 src/time/FileTime.hxx | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/time/FileTime.hxx b/src/time/FileTime.hxx
index f3d491e20..57632d428 100644
--- a/src/time/FileTime.hxx
+++ b/src/time/FileTime.hxx
@@ -42,11 +42,16 @@ ConstructUint64(DWORD lo, DWORD hi) noexcept
 	return uint64_t(lo) | (uint64_t(hi) << 32);
 }
 
+constexpr uint64_t
+ToUint64(FILETIME ft) noexcept
+{
+	return ConstructUint64(ft.dwLowDateTime, ft.dwHighDateTime);
+}
+
 constexpr time_t
 FileTimeToTimeT(FILETIME ft) noexcept
 {
-	return (ConstructUint64(ft.dwLowDateTime, ft.dwHighDateTime)
-		- 116444736000000000) / 10000000;
+	return (ToUint64(ft) - 116444736000000000) / 10000000;
 }
 
 inline std::chrono::system_clock::time_point