From e957d7bbfb4a3e73a332309be4051987dd265935 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 28 Aug 2024 17:52:08 -0400 Subject: [PATCH] use std::filesystem for windows --- libi2pd/FS.cpp | 8 ++++---- libi2pd/FS.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libi2pd/FS.cpp b/libi2pd/FS.cpp index eb17af55..61bdefe0 100644 --- a/libi2pd/FS.cpp +++ b/libi2pd/FS.cpp @@ -61,7 +61,7 @@ namespace fs { const std::string GetUTF8DataDir () { #ifdef _WIN32 -#if (BOOST_VERSION >= 108500) +#if ((BOOST_VERSION >= 108500) || STD_FILESYSTEM) fs_lib::path path (dataDir); #else fs_lib::wpath path (dataDir); @@ -98,7 +98,7 @@ namespace fs { } else { -#if (BOOST_VERSION >= 108500) +#if ((BOOST_VERSION >= 108500) || STD_FILESYSTEM) dataDir = fs_lib::path(commonAppData).string() + "\\" + appName; #else dataDir = fs_lib::wpath(commonAppData).string() + "\\" + appName; @@ -127,7 +127,7 @@ namespace fs { } else { -#if (BOOST_VERSION >= 108500) +#if ((BOOST_VERSION >= 108500) || STD_FILESYSTEM) auto execPath = fs_lib::path(localAppData).parent_path(); #else auto execPath = fs_lib::wpath(localAppData).parent_path(); @@ -150,7 +150,7 @@ namespace fs { } else { -#if (BOOST_VERSION >= 108500) +#if ((BOOST_VERSION >= 108500) || STD_FILESYSTEM) dataDir = fs_lib::path(localAppData).string() + "\\" + appName; #else dataDir = fs_lib::wpath(localAppData).string() + "\\" + appName; diff --git a/libi2pd/FS.h b/libi2pd/FS.h index 01fa101f..a4682199 100644 --- a/libi2pd/FS.h +++ b/libi2pd/FS.h @@ -15,7 +15,7 @@ #include #include -#if (!defined(_WIN32) && !defined(MAC_OSX) && !TARGET_OS_SIMULATOR && \ +#if (!defined(MAC_OSX) && !TARGET_OS_SIMULATOR && \ (__cplusplus >= 201703L) && defined(__cpp_lib_filesystem)) // C++ 17 or higher supporting filesystem # define STD_FILESYSTEM 1 #endif