From 1114eb9aaf805851aa68146959b71e3fbbab36b0 Mon Sep 17 00:00:00 2001
From: ShizZy <shizzy@6bit.net>
Date: Mon, 23 Sep 2013 21:47:24 -0400
Subject: [PATCH] added localtime_r for use on windows

---
 src/common/src/platform.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/common/src/platform.h b/src/common/src/platform.h
index d610b418aa..d8eacaa84d 100644
--- a/src/common/src/platform.h
+++ b/src/common/src/platform.h
@@ -70,9 +70,17 @@
 
 #if EMU_PLATFORM == PLATFORM_WINDOWS
 
+#include <time.h>
+
 #define NOMINMAX
 #define EMU_FASTCALL __fastcall
 
+inline struct tm* localtime_r(const time_t *clock, struct tm *result) {
+	if (localtime_s(result, clock) == 0)
+		return result;
+	return NULL;
+}
+
 #else
 
 #define EMU_FASTCALL __attribute__((fastcall))