Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

added localtime_r for use on windows

ShizZy1114eb9aaf80
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))