Go to the documentation of this file. 23 #ifndef _LIBRETRO_ENCODINGS_WIN32_H 24 #define _LIBRETRO_ENCODINGS_WIN32_H 46 #define CHAR_TO_WCHAR_ALLOC(s, ws) \ 47 size_t ws##_size = (NULL != s && s[0] ? strlen(s) : 0) + 1; \ 48 wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ 49 if (NULL != s && s[0]) \ 50 MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); 52 #define WCHAR_TO_CHAR_ALLOC(ws, s) \ 53 size_t s##_size = ((NULL != ws && ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ 54 char *s = (char*)calloc(s##_size, 1); \ 55 if (NULL != ws && ws[0]) \ 56 utf16_to_char_string((const uint16_t*)ws, s, s##_size); 59 #define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = (NULL != s && s[0] ? strdup(s) : NULL); 60 #define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = (NULL != ws && ws[0] ? strdup(ws) : NULL);