mirror of https://github.com/mgba-emu/mgba.git
GBA Hardware: Use localtime_s on Win32 and PSP2
This commit is contained in:
parent
d60e4972e9
commit
305e8c009c
|
@ -8,10 +8,6 @@
|
||||||
#include "gba/serialize.h"
|
#include "gba/serialize.h"
|
||||||
#include "util/hash.h"
|
#include "util/hash.h"
|
||||||
|
|
||||||
#ifdef PSP2
|
|
||||||
#include <psp2/rtc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void _readPins(struct GBACartridgeHardware* hw);
|
static void _readPins(struct GBACartridgeHardware* hw);
|
||||||
static void _outputPins(struct GBACartridgeHardware* hw, unsigned pins);
|
static void _outputPins(struct GBACartridgeHardware* hw, unsigned pins);
|
||||||
|
|
||||||
|
@ -260,12 +256,8 @@ void _rtcUpdateClock(struct GBACartridgeHardware* hw) {
|
||||||
t = time(0);
|
t = time(0);
|
||||||
}
|
}
|
||||||
struct tm date;
|
struct tm date;
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) || defined(PSP2)
|
||||||
date = *localtime(&t);
|
localtime_s(&date, &t);
|
||||||
#elif defined(PSP2)
|
|
||||||
SceRtcTime scertc;
|
|
||||||
sceRtcGetCurrentClockLocalTime(&scertc);
|
|
||||||
sceRtcGetTime_t(&scertc, &t);
|
|
||||||
#else
|
#else
|
||||||
localtime_r(&t, &date);
|
localtime_r(&t, &date);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue