Emulation implementation is incorrect as it does not use code page set by
the _setmbcp() call. Improper emulation of _ismbblead() was added only for
crtexewin.c usage and it is not needed anymore as crtexewin.c does not call
_ismbblead() anymore. So remove mingw-w64 _ismbblead() emulation.
---
 mingw-w64-crt/Makefile.am                |  4 +--
 mingw-w64-crt/lib32/crtdll.def.in        |  2 +-
 mingw-w64-crt/misc/crtdll__ismbblead.c   | 45 ------------------------
 mingw-w64-crt/misc/msvcrt10__ismbblead.c | 14 --------
 4 files changed, 2 insertions(+), 63 deletions(-)
 delete mode 100644 mingw-w64-crt/misc/crtdll__ismbblead.c
 delete mode 100644 mingw-w64-crt/misc/msvcrt10__ismbblead.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index d7e5867404ea..da4d1a99f487 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -964,7 +964,6 @@ src_crtdll=\
   $(src_pre_msvcr110) \
   $(src_pre_msvcr120) \
   misc/crtdll__getmainargs.c \
-  misc/crtdll__ismbblead.c \
   misc/crtdll_fstat.c \
   misc/crtdll_stat.c \
   misc/__p__mbctype.c
@@ -979,8 +978,7 @@ src_msvcrt10=\
   $(src_pre_msvcr100) \
   $(src_pre_msvcr110) \
   $(src_pre_msvcr120) \
-  misc/crtdll__getmainargs.c \
-  misc/msvcrt10__ismbblead.c
+  misc/crtdll__getmainargs.c
 
 src_msvcrt20=\
   $(src_pre_msvcrt40) \
diff --git a/mingw-w64-crt/lib32/crtdll.def.in 
b/mingw-w64-crt/lib32/crtdll.def.in
index 8ffaa3adf385..3e3d80421150 100644
--- a/mingw-w64-crt/lib32/crtdll.def.in
+++ b/mingw-w64-crt/lib32/crtdll.def.in
@@ -227,7 +227,7 @@ _ismbbgraph
 _ismbbkalnum
 _ismbbkana
 _ismbbkpunct
-; _ismbblead is replaced by emu
+_ismbblead
 _ismbbprint
 _ismbbpunct
 _ismbbtrail
diff --git a/mingw-w64-crt/misc/crtdll__ismbblead.c 
b/mingw-w64-crt/misc/crtdll__ismbblead.c
deleted file mode 100644
index 4854c43bf20d..000000000000
--- a/mingw-w64-crt/misc/crtdll__ismbblead.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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 <internal.h>
-#include <windows.h>
-
-/**
- * Implementation of _ismbblead() function called by crtexewin.c startup code
- * for crtdll.dll library which in some versions does not contain this 
function.
- */
-
-static int __cdecl emu_ismbblead(unsigned int __UNUSED_PARAM(_C))
-{
-    /* Fallback implementation for crtdll.dll version which is not MBCS aware. 
*/
-    return 0;
-}
-
-static int __cdecl init_ismbblead(unsigned int _C);
-
-int (__cdecl *__MINGW_IMP_SYMBOL(_ismbblead))(unsigned int _C) = 
init_ismbblead;
-
-static int __cdecl init_ismbblead(unsigned int _C)
-{
-    HMODULE crtdll;
-    int (__cdecl *func)(unsigned int _C) = NULL;
-
-    crtdll = GetModuleHandleA("crtdll.dll");
-
-    if (crtdll)
-        func = (int (__cdecl *)(unsigned int _C))GetProcAddress(crtdll, 
"_ismbblead");
-
-    if (!func)
-        func = emu_ismbblead;
-
-    return (__MINGW_IMP_SYMBOL(_ismbblead) = func)(_C);
-}
-
-int __cdecl _ismbblead(unsigned int _C);
-int __cdecl _ismbblead(unsigned int _C)
-{
-    return __MINGW_IMP_SYMBOL(_ismbblead)(_C);
-}
diff --git a/mingw-w64-crt/misc/msvcrt10__ismbblead.c 
b/mingw-w64-crt/misc/msvcrt10__ismbblead.c
deleted file mode 100644
index e38fe439d1c2..000000000000
--- a/mingw-w64-crt/misc/msvcrt10__ismbblead.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * 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 <internal.h>
-
-/**
- * Implementation of _ismbblead() function called by crtexewin.c startup code
- * for msvcrt10.dll library which does not contain this function and is not 
MBCS aware.
- */
-int __cdecl _ismbblead(unsigned int _C);
-int __cdecl _ismbblead(unsigned int __UNUSED_PARAM(_C)) { return 0; }
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to