Fix WIN32 define timing in IGFD

When the compiler hits IGFD, WIN32 is only set if standard extensions are enabled. (Why?)
IGFD identifies Windows via WIN32 instead of _WIN32. (Why?)

- WIN32 is needed for #ifdef-gated Windows-specific methods in the header & code files.
  - There's fallback code in the code file to set WIN32 if _WIN32 or __WIN32__ is set.
    - Which is hit *after* the header gets included, so the header doesn't expose required methods.
      -> Boom, error!

Workaround by moving the fallback into the header.
This commit is contained in:
OPNA2608 2022-05-08 00:29:43 +02:00
parent 58fc35227e
commit 3d00e1d784
2 changed files with 7 additions and 4 deletions

View File

@ -44,10 +44,7 @@ SOFTWARE.
#if defined (__EMSCRIPTEN__) // EMSCRIPTEN
#include <emscripten.h>
#endif // EMSCRIPTEN
#if defined(__WIN32__) || defined(_WIN32)
#ifndef WIN32
#define WIN32
#endif // WIN32
#ifdef WIN32
#define stat _stat
#define stricmp _stricmp
#include <cctype>

View File

@ -581,6 +581,12 @@ ImGuiFontStudio is using also ImGuiFileDialog.
#ifndef IMGUIFILEDIALOG_H
#define IMGUIFILEDIALOG_H
#if defined(__WIN32__) || defined(_WIN32)
#ifndef WIN32
#define WIN32
#endif // WIN32
#endif // defined(__WIN32__) || defined(_WIN32)
#define IMGUIFILEDIALOG_VERSION "v0.6.4"
#ifndef CUSTOM_IMGUIFILEDIALOG_CONFIG