Fixed a build issue with non-Cygwin GCC under Windows.

This commit is contained in:
omar 2018-09-04 18:58:20 +02:00
parent 5451cb7e1e
commit 40db2ca098
2 changed files with 2 additions and 1 deletions

View file

@ -34,6 +34,7 @@ HOW TO UPDATE?
Other Changes: Other Changes:
- Fixed a build issue with non-Cygwin GCC under Windows.
- Examples: OpenGL3: Fixed error condition when using the GLAD loader. (#2059, #2002). [@jiri] - Examples: OpenGL3: Fixed error condition when using the GLAD loader. (#2059, #2002). [@jiri]

View file

@ -1506,7 +1506,7 @@ int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_e
FILE* ImFileOpen(const char* filename, const char* mode) FILE* ImFileOpen(const char* filename, const char* mode)
{ {
#if defined(_WIN32) && !defined(__CYGWIN__) #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__GNUC__)
// We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can) // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames. Converting both strings from UTF-8 to wchar format (using a single allocation, because we can)
const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1; const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1; const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;