Revert using wchar_t functions (9cf94d5 + 2eaf5b0). Big mistake, wchar_t is not guaranteed to be 16-bits.

This commit is contained in:
omar
2018-10-12 15:48:38 +02:00
parent 28953208d4
commit ca753829cb
3 changed files with 18 additions and 12 deletions

View File

@ -850,7 +850,6 @@ CODE
#include <ctype.h> // toupper, isprint
#include <stdio.h> // vsnprintf, sscanf, printf
#include <wchar.h> // wcslen
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
@ -1220,7 +1219,10 @@ const char* ImStrchrRange(const char* str, const char* str_end, char c)
int ImStrlenW(const ImWchar* str)
{
return (int)wcslen((const wchar_t*)str);
//return (int)wcslen((const wchar_t*)str); // FIXME-OPT: Could use this when wchar_t are 16-bits
int n = 0;
while (*str++) n++;
return n;
}
// Find end-of-line. Return pointer will point to either first \n, either str_end.