MSVC: compat: implement localtime_r

The Windows version of localtime_s swaps the argument order and has a
different return type for increased level of fun.
diff --git a/CMakeModules/UseCompat.cmake b/CMakeModules/UseCompat.cmake
index 31bd59f..d81f28c 100644
--- a/CMakeModules/UseCompat.cmake
+++ b/CMakeModules/UseCompat.cmake
@@ -52,6 +52,7 @@
     check_symbol_exists(timezone time.h HAVE_TIME_H_TIMEZONE)
 
     check_symbol_exists(realpath "stdlib.h" HAVE_REALPATH)
+    check_symbol_exists(localtime_r "time.h" HAVE_LOCALTIME_R)
 
     unset(CMAKE_REQUIRED_DEFINITIONS)
     unset(CMAKE_REQUIRED_LIBRARIES)