all repos — mgba @ 305e8c009c420bbadfef0478742d1e7111491599

mGBA Game Boy Advance Emulator

GBA Hardware: Use localtime_s on Win32 and PSP2
Jeffrey Pfau jeffrey@endrift.com
Wed, 08 Jul 2015 19:28:28 -0700
commit

305e8c009c420bbadfef0478742d1e7111491599

parent

d60e4972e9caff5709327daf20c5930507c0fed8

1 files changed, 2 insertions(+), 10 deletions(-)

jump to
M src/gba/hardware.csrc/gba/hardware.c

@@ -8,10 +8,6 @@

#include "gba/serialize.h" #include "util/hash.h" -#ifdef PSP2 -#include <psp2/rtc.h> -#endif - static void _readPins(struct GBACartridgeHardware* hw); static void _outputPins(struct GBACartridgeHardware* hw, unsigned pins);

@@ -260,12 +256,8 @@ } else {

t = time(0); } struct tm date; -#ifdef _WIN32 - date = *localtime(&t); -#elif defined(PSP2) - SceRtcTime scertc; - sceRtcGetCurrentClockLocalTime(&scertc); - sceRtcGetTime_t(&scertc, &t); +#if defined(_WIN32) || defined(PSP2) + localtime_s(&date, &t); #else localtime_r(&t, &date); #endif