From a1f40d30488b21ec064416da6792c92e33263708 Mon Sep 17 00:00:00 2001 From: orignal Date: Fri, 30 Aug 2024 17:56:34 -0400 Subject: [PATCH] use __has_include()) to detect if std::filesystem can be used --- libi2pd/FS.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libi2pd/FS.h b/libi2pd/FS.h index 45155451..006ee68d 100644 --- a/libi2pd/FS.h +++ b/libi2pd/FS.h @@ -16,13 +16,12 @@ #include #ifndef STD_FILESYSTEM -#if (!defined(MAC_OSX) && !TARGET_OS_SIMULATOR && \ - (__cplusplus >= 201703L) && defined(__cpp_lib_filesystem)) // C++ 17 or higher supporting std::filesystem -# define STD_FILESYSTEM 1 -#else -# define STD_FILESYSTEM 0 -#endif - +# if (!defined(MAC_OSX) && !TARGET_OS_SIMULATOR && \ + (__cplusplus >= 201703L) && __has_include()) // C++ 17 or higher and supports std::filesystem +# define STD_FILESYSTEM 1 +# else +# define STD_FILESYSTEM 0 +# endif #endif namespace i2p {