---
mingw-w64-crt/Makefile.am | 1 +
mingw-w64-crt/lib-common/msvcrt.def.in | 2 +-
mingw-w64-crt/misc/_localtime32.c | 18 ++++++++++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 mingw-w64-crt/misc/_localtime32.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 031ad36e40a4..d9578c909253 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -671,6 +671,7 @@ src_msvcrt64=\
misc/_get_fmode.c \
misc/_gmtime32.c \
misc/_initterm_e.c \
+ misc/_localtime32.c \
misc/_mkgmtime32.c \
misc/_set_doserrno.c \
misc/_set_fmode.c \
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index a0e6603f5b3e..1e7eda60a510 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1503,7 +1503,7 @@ _itoa_s
_itow_s
_lfind_s
F_I386(_local_unwind4)
-_localtime32 F_I386(== localtime) ; i386 _localtime32 replaced by alias
+F_NON_X64(_localtime32 F_I386(== localtime)) ; i386 _localtime32 replaced by
alias and x64 _localtime32 replaced by emu
F_ARM_ANY(_localtime32_s) ; i386 and x64 _localtime32_s replaced by emu
F_ARM_ANY(_localtime64_s) ; i386 and x64 _localtime64_s replaced by emu
_lsearch_s
diff --git a/mingw-w64-crt/misc/_localtime32.c
b/mingw-w64-crt/misc/_localtime32.c
new file mode 100644
index 000000000000..c4a5d79f3ed1
--- /dev/null
+++ b/mingw-w64-crt/misc/_localtime32.c
@@ -0,0 +1,18 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <time.h>
+
+static struct tm *__cdecl emu__localtime32(const __time32_t *timeptr)
+{
+ return _localtime64(&(__time64_t){ *timeptr });
+}
+
+#define RETT struct tm *
+#define FUNC _localtime32
+#define ARGS const __time32_t *timeptr
+#define CALL timeptr
+#include "msvcrt_or_emu_glue.h"
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public