From 3fa56584b92f59ac244c6ca4e56d080d3d0f3f3c Mon Sep 17 00:00:00 2001 From: Iain Russell Date: Tue, 19 Dec 2023 15:56:12 +0000 Subject: [PATCH] Tighten up test for std::filesystem with gcc 7.5 [MAGP-1356] --- src/web/MagConfig.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/web/MagConfig.cc b/src/web/MagConfig.cc index 8691cde0..d07cf41b 100644 --- a/src/web/MagConfig.cc +++ b/src/web/MagConfig.cc @@ -18,7 +18,15 @@ #include "Value.h" -#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) +#define STD_FILESYSTEM_INCLUDE_MISSING 0 +#ifdef __has_include + #if !__has_include() + #define STD_FILESYSTEM_INCLUDE_MISSING 1 + #endif +#endif + + +#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (__cplusplus >= 201703L) && !STD_FILESYSTEM_INCLUDE_MISSING) #include namespace fs = std::filesystem; #else @@ -579,4 +587,4 @@ bool PaletteLibrary::find(string& name, Palette& out) { } return false; -} \ No newline at end of file +}