diff options
| author | Saikari <[email protected]> | 2026-01-17 08:19:05 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-17 08:19:05 +0300 |
| commit | c466d7ca16843055bca74d33e8f2fc24331d69b8 (patch) | |
| tree | a7fda904ae5e0ae5db2590c786a21cddc6b959ce | |
| parent | ee2f9eaac207c1b728a17c24287cd69076df74d9 (diff) | |
try win
| -rw-r--r-- | core/src/xmake/string/case.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/xmake/string/case.c b/core/src/xmake/string/case.c index 9206cafa2..762110bd9 100644 --- a/core/src/xmake/string/case.c +++ b/core/src/xmake/string/case.c @@ -30,6 +30,9 @@ */ #include "prefix.h" #include <wctype.h> +#ifdef TB_CONFIG_OS_WINDOWS +# include <windows.h> +#endif /* ////////////////////////////////////////////////////////////////////////////////////// * helper @@ -58,10 +61,15 @@ static tb_int_t xm_string_case(lua_State* lua, tb_bool_t lower) { if (wn != -1) { // to case +#ifdef TB_CONFIG_OS_WINDOWS + if (lower) CharLowerBuffW((LPWSTR)wb, (DWORD)wn); + else CharUpperBuffW((LPWSTR)wb, (DWORD)wn); +#else tb_size_t i = 0; for (i = 0; i < wn; i++) { wb[i] = lower? towlower(wb[i]) : towupper(wb[i]); } +#endif // convert to utf8 tb_size_t un = (wn + 1) * 4; |
