With this change whole mingw-w64-crt now uses helper CRT function
__mingw_isleadbyte_cp insted of WinAPI function IsDBCSLeadByteEx.
---
mingw-w64-crt/misc/dirname.c | 4 ++--
mingw-w64-crt/stdio/__mingw_fix_stat_path.c | 2 +-
mingw-w64-crt/testcases/t_btowc.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mingw-w64-crt/misc/dirname.c b/mingw-w64-crt/misc/dirname.c
index 239d5db8d635..6d0330ce569a 100644
--- a/mingw-w64-crt/misc/dirname.c
+++ b/mingw-w64-crt/misc/dirname.c
@@ -113,7 +113,7 @@ do_get_path_info(struct path_info* info, char* path)
if(dbcs_tb)
dbcs_tb = 0;
- else if(IsDBCSLeadByteEx(cp, *pos))
+ else if(__mingw_isleadbyte_cp(*pos, cp))
dbcs_tb = 1;
else
dir_sep = IS_DIR_SEP(*pos);
@@ -157,7 +157,7 @@ do_get_path_info(struct path_info* info, char* path)
if(dbcs_tb)
dbcs_tb = 0;
- else if(IsDBCSLeadByteEx(cp, *pos))
+ else if(__mingw_isleadbyte_cp(*pos, cp))
dbcs_tb = 1;
else
dir_sep = IS_DIR_SEP(*pos);
diff --git a/mingw-w64-crt/stdio/__mingw_fix_stat_path.c
b/mingw-w64-crt/stdio/__mingw_fix_stat_path.c
index b853d1d1ea81..05c029e3c6a7 100644
--- a/mingw-w64-crt/stdio/__mingw_fix_stat_path.c
+++ b/mingw-w64-crt/stdio/__mingw_fix_stat_path.c
@@ -17,7 +17,7 @@ static const char* next_char (unsigned int cp, const char* p)
{
/* If it is a lead byte, skip the next byte except if it is \0.
* If it is \0, it's not a valid DBCS string. */
- return (IsDBCSLeadByteEx (cp, *p) && p[1] != '\0') ? p + 2 : p + 1;
+ return (__mingw_isleadbyte_cp (*p, cp) && p[1] != '\0') ? p + 2 : p + 1;
}
/**
diff --git a/mingw-w64-crt/testcases/t_btowc.c
b/mingw-w64-crt/testcases/t_btowc.c
index cb71973c8e00..a6916f017161 100644
--- a/mingw-w64-crt/testcases/t_btowc.c
+++ b/mingw-w64-crt/testcases/t_btowc.c
@@ -78,7 +78,7 @@ int main (void) {
* Try to convert lead bytes
*/
for (int c = 0x80; c < 0x100; ++c) {
- if (IsDBCSLeadByteEx (932, (BYTE) c)) {
+ if (__mingw_isleadbyte_cp ((BYTE) c, 932)) {
assert (btowc (c) == WEOF);
}
}
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public