From d0524c025e77729b6f54e769cad0e8999b8771b3 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 6 May 2022 12:40:33 +0200 Subject: [PATCH 1/4] Forbid standard extensions Standard or bust. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index eaa1781d7..ace97d09f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,10 @@ if (APPLE) enable_language(OBJC) endif() +set(CMAKE_C_EXTENSIONS OFF) + set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_PROJECT_VERSION_MAJOR 0) set(CMAKE_PROJECT_VERSION_MINOR 6) From b35701f938693c174237fe92b4f098b4236ad61c Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 6 May 2022 12:52:47 +0200 Subject: [PATCH 2/4] Maybe just enforce for C++ We don't demand a specific standard for C anyway, maybe that'll trip it up less? --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ace97d09f..b41090d5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,6 @@ if (APPLE) enable_language(OBJC) endif() -set(CMAKE_C_EXTENSIONS OFF) - set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_EXTENSIONS OFF) From 58fc35227e4c4d937449cdc9309a40079d7fb1dc Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sat, 7 May 2022 23:31:40 +0200 Subject: [PATCH 3/4] Fix outdated calling convention in SAASound (maybe fix MinGW) https://docs.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170 > For compatibility with previous versions, _stdcall is a synonym for __stdcall > unless compiler option /Za (Disable language extensions) is specified. --- extern/SAASound/src/SAASound.h | 2 +- extern/SAASound/src/types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/SAASound/src/SAASound.h b/extern/SAASound/src/SAASound.h index 7496cc360..d55e80a7d 100644 --- a/extern/SAASound/src/SAASound.h +++ b/extern/SAASound/src/SAASound.h @@ -53,7 +53,7 @@ typedef unsigned long SAAPARAM; #endif #ifdef _WIN32 -#define SAAAPI _stdcall +#define SAAAPI __stdcall #else #define SAAAPI #endif diff --git a/extern/SAASound/src/types.h b/extern/SAASound/src/types.h index 8cce21247..2ed26ff74 100755 --- a/extern/SAASound/src/types.h +++ b/extern/SAASound/src/types.h @@ -30,7 +30,7 @@ typedef struct } ENVDATA; #ifdef WIN32 -extern "C" void _stdcall OutputDebugStringA (char*); +extern "C" void __stdcall OutputDebugStringA (char*); #endif #endif From 3d00e1d784bd98d2e50c5cf075001e9a4c5bb347 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 8 May 2022 00:29:43 +0200 Subject: [PATCH 4/4] 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. --- extern/igfd/ImGuiFileDialog.cpp | 5 +---- extern/igfd/ImGuiFileDialog.h | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/extern/igfd/ImGuiFileDialog.cpp b/extern/igfd/ImGuiFileDialog.cpp index 98d6c909a..f4641e976 100644 --- a/extern/igfd/ImGuiFileDialog.cpp +++ b/extern/igfd/ImGuiFileDialog.cpp @@ -44,10 +44,7 @@ SOFTWARE. #if defined (__EMSCRIPTEN__) // EMSCRIPTEN #include #endif // EMSCRIPTEN -#if defined(__WIN32__) || defined(_WIN32) - #ifndef WIN32 - #define WIN32 - #endif // WIN32 +#ifdef WIN32 #define stat _stat #define stricmp _stricmp #include diff --git a/extern/igfd/ImGuiFileDialog.h b/extern/igfd/ImGuiFileDialog.h index 016bd9a10..e5ba92d0c 100644 --- a/extern/igfd/ImGuiFileDialog.h +++ b/extern/igfd/ImGuiFileDialog.h @@ -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