mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Revert using wchar_t functions (9cf94d5
+ 2eaf5b0
). Big mistake, wchar_t is not guaranteed to be 16-bits.
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user