Sfoglia il codice sorgente

added localtime_r for use on windows

ShizZy 13 anni fa
parent
commit
1114eb9aaf
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      src/common/src/platform.h

+ 8 - 0
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))