From bedc2b43ad5e6bf8eef5822f3a247031e330f85d Mon Sep 17 00:00:00 2001 From: dolphin6k Date: Sun, 10 Oct 2021 14:49:33 +0900 Subject: [PATCH] Removed old unnecessary windows specific code which cause crash bug. --- src/onscreen_keyboard.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/onscreen_keyboard.c b/src/onscreen_keyboard.c index 4875a73b4..e08882286 100644 --- a/src/onscreen_keyboard.c +++ b/src/onscreen_keyboard.c @@ -51,38 +51,6 @@ static struct osk_layout *load_layout(on_screen_keyboard * keyboard, char *layou static void print_composemap(osk_composenode * composemap, char *sp); #endif -#ifdef WIN32 -#include -#define wcstok(line, delim, pointer) wcstok(line, delim) -#define strtok_r(line, delim, pointer) strtok(line, delim) - -static void mtw(wchar_t * wtok, char *tok); - -static void mtw(wchar_t * wtok, char *tok) -{ - /* workaround using iconv to get a functionallity somewhat approximate as mbstowcs() */ - Uint16 *ui16; - char *wrptr; - size_t n, in, out; - iconv_t trans; - - n = 255; - in = 250; - out = 250; - ui16 = malloc(sizeof(Uint16) * 255); - wrptr = (char *)ui16; - - trans = iconv_open("WCHAR_T", "UTF-8"); - iconv(trans, (const char **)&tok, &in, &wrptr, &out); - *((wchar_t *) wrptr) = L'\0'; - swprintf(wtok, L"%ls", ui16); - free(ui16); - iconv_close(trans); -} - -#define mbstowcs(wtok, tok, size) mtw(wtok, tok) -#endif - struct osk_keyboard *osk_create(char * layout_name, SDL_Surface * canvas, SDL_Surface * LG_button_up, SDL_Surface * LG_button_down, SDL_Surface * LG_button_off, SDL_Surface * LG_button_nav,