1
0
mirror of https://github.com/ocornut/imgui.git synced 2025-02-02 12:37:20 +01:00

Fixed MinGW builds uses UTF-8 friendly _wfopen(). (#8300)

Amend bbd0a37bd, 40db2ca09
This commit is contained in:
ocornut 2025-01-09 15:28:48 +01:00
parent c7983115e9
commit 940d9540f3
2 changed files with 2 additions and 1 deletions

View File

@ -67,6 +67,7 @@ Other changes:
created from a single comma character, affecting some fonts/settings (not all). created from a single comma character, affecting some fonts/settings (not all).
- Demo: Added label edition to Property Editor demo + fix an ID issue. (#8266) [@moritz-h] - Demo: Added label edition to Property Editor demo + fix an ID issue. (#8266) [@moritz-h]
- Misc: Fixed misc/cpp/imgui_stdlib.h/.cpp not supporting IMGUI_DISABLE. (#8294) [@juur] - Misc: Fixed misc/cpp/imgui_stdlib.h/.cpp not supporting IMGUI_DISABLE. (#8294) [@juur]
- Misc: Fixed MinGW builds uses UTF-8 friendly _wfopen(). (#8300)
- Backends: Allegro5: Avoid calling al_set_mouse_cursor() repeatedly since it appears - Backends: Allegro5: Avoid calling al_set_mouse_cursor() repeatedly since it appears
to leak on on X11 (#8256). [@Helodity] to leak on on X11 (#8256). [@Helodity]
- Backends: Metal: Fixed leaks when using metal-cpp. (#8276, #8166) [@selimsandal] - Backends: Metal: Fixed leaks when using metal-cpp. (#8276, #8166) [@selimsandal]

View File

@ -2282,7 +2282,7 @@ ImGuiID ImHashStr(const char* data_p, size_t data_size, ImGuiID seed)
ImFileHandle ImFileOpen(const char* filename, const char* mode) ImFileHandle ImFileOpen(const char* filename, const char* mode)
{ {
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__) #if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && (defined(__MINGW32__) || (!defined(__CYGWIN__) && !defined(__GNUC__)))
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
// Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32! // Previously we used ImTextCountCharsFromUtf8/ImTextStrFromUtf8 here but we now need to support ImWchar16 and ImWchar32!
const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0); const int filename_wsize = ::MultiByteToWideChar(CP_UTF8, 0, filename, -1, NULL, 0);