---
mingw-w64-crt/Makefile.am | 1 +
mingw-w64-crt/lib-common/msvcrt.def.in | 2 +-
mingw-w64-crt/misc/_ftime32.c | 22 ++++++++++++++++++++++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 mingw-w64-crt/misc/_ftime32.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 402ada8c10f3..5eca279eab4d 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -664,6 +664,7 @@ src_msvcrt64=\
misc/_ctime32.c \
misc/_difftime32.c \
misc/_free_locale.c \
+ misc/_ftime32.c \
misc/_get_current_locale.c \
misc/_get_doserrno.c \
misc/_get_fmode.c \
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 986912d0aa12..6ace3b56223a 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1410,7 +1410,7 @@ F_X86_ANY(_freea_s)
_fscanf_l
_fscanf_s_l
F_ARM_ANY(_fseeki64) ; i386 and x64 _fseeki64 replaced by emu
-_ftime32 F_I386(== _ftime) ; i386 _ftime32 replaced by alias
+F_NON_X64(_ftime32 F_I386(== _ftime)) ; i386 _ftime32 replaced by alias and
x64 _ftime32 replaced by emu
_ftime32_s
_ftime64_s
F_I386(_ftol2)
diff --git a/mingw-w64-crt/misc/_ftime32.c b/mingw-w64-crt/misc/_ftime32.c
new file mode 100644
index 000000000000..081e7ca6a7d9
--- /dev/null
+++ b/mingw-w64-crt/misc/_ftime32.c
@@ -0,0 +1,22 @@
+/**
+ * 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 <sys/timeb.h>
+
+static void __cdecl emu__ftime32(struct __timeb32 *tb32)
+{
+ struct __timeb64 tb64;
+ _ftime64(&tb64);
+ tb32->time = (__time32_t)tb64.time; /* truncate */
+ tb32->millitm = tb64.millitm;
+ tb32->timezone = tb64.timezone;
+}
+
+#define RETT void
+#define FUNC _ftime32
+#define ARGS struct __timeb32 *tb
+#define CALL tb
+#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