Ensure that the ___lc_handle_func symbol is available for all builds which
uses msvcrt.dll and msvcrtd.dll runtime DLLs. ___lc_handle_func() emulation
uses the global __lc_handle variable which is present in all msvcrt.dll and
msvcrtd.dll versions.
---
mingw-w64-crt/Makefile.am | 2 ++
mingw-w64-crt/lib-common/msvcrt.def.in | 2 +-
mingw-w64-crt/misc/___lc_handle_func.c | 22 ++++++++++++++++++++++
3 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 mingw-w64-crt/misc/___lc_handle_func.c
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index a296bd804779..6cabe04c171d 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -549,6 +549,7 @@ src_msvcrt32=\
misc/msvcrt__getmainargs.c \
misc/msvcrt__wgetmainargs.c \
math/i386__copysignf.c \
+ misc/___lc_handle_func.c \
misc/___mb_cur_max_func.c \
misc/__p__osplatform.c \
misc/__pctype_func.c \
@@ -1013,6 +1014,7 @@ src_msvcrtd=\
$(src_pre_msvcr100) \
$(src_pre_msvcr110) \
$(src_pre_msvcr120) \
+ misc/___lc_handle_func.c \
misc/msvcrt__getmainargs.c \
misc/msvcrt__wgetmainargs.c
diff --git a/mingw-w64-crt/lib-common/msvcrt.def.in
b/mingw-w64-crt/lib-common/msvcrt.def.in
index 2565bccc01a7..a7bb31f27612 100644
--- a/mingw-w64-crt/lib-common/msvcrt.def.in
+++ b/mingw-w64-crt/lib-common/msvcrt.def.in
@@ -1192,7 +1192,7 @@ F_I386(__CxxRegisterExceptionObject)
F_I386(__CxxUnregisterExceptionObject)
__DestructExceptionObject
F_NON_I386(___lc_codepage_func) ; i386 ___lc_codepage_func replaced by emu
-___lc_handle_func
+F_NON_I386(___lc_handle_func) ; i386 ___lc_handle_func replaced by emu
F_NON_I386(___mb_cur_max_func) ; i386 ___mb_cur_max_func replaced by emu
F_X86_ANY(___setlc_active_func)
F_X86_ANY(___unguarded_readlc_active_add_func)
diff --git a/mingw-w64-crt/misc/___lc_handle_func.c
b/mingw-w64-crt/misc/___lc_handle_func.c
new file mode 100644
index 000000000000..fad5ba99932e
--- /dev/null
+++ b/mingw-w64-crt/misc/___lc_handle_func.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 <locale.h>
+#include <windows.h>
+
+extern LCID *__MINGW_IMP_SYMBOL(__lc_handle);
+
+static LCID *__cdecl emu____lc_handle_func(void)
+{
+ return __MINGW_IMP_SYMBOL(__lc_handle);
+}
+
+LCID *__cdecl ___lc_handle_func(void);
+#define RETT LCID*
+#define FUNC ___lc_handle_func
+#define ARGS void
+#define CALL
+#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