Merge pull request #8206 from JosJuice/filesystem-include

Replace <experimental/filesystem> includes with <filesystem>
This commit is contained in:
Léo Lam 2019-06-20 12:20:03 +02:00 committed by GitHub
commit 49adbcb9ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -39,7 +39,7 @@ Dolphin can only be installed on devices that satisfy the above requirements. At
## Building for Windows ## Building for Windows
Use the solution file `Source/dolphin-emu.sln` to build Dolphin on Windows. Use the solution file `Source/dolphin-emu.sln` to build Dolphin on Windows.
Visual Studio 2017 is a hard requirement. Other compilers might be Visual Studio 2017 15.7 is a hard requirement. Other compilers might be
able to build Dolphin on Windows but have not been tested and are not able to build Dolphin on Windows but have not been tested and are not
recommended to be used. Git and Windows 10 SDK 10.0.17134.0 must be installed when building. recommended to be used. Git and Windows 10 SDK 10.0.17134.0 must be installed when building.

View File

@ -10,8 +10,8 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#include <Windows.h> #include <Windows.h>
#include <experimental/filesystem> #include <filesystem>
namespace fs = std::experimental::filesystem; namespace fs = std::filesystem;
#define HAS_STD_FILESYSTEM #define HAS_STD_FILESYSTEM
#else #else
#include <cstring> #include <cstring>

View File

@ -5,8 +5,8 @@
#include "Core/Boot/Boot.h" #include "Core/Boot/Boot.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#include <experimental/filesystem> #include <filesystem>
namespace fs = std::experimental::filesystem; namespace fs = std::filesystem;
#define HAS_STD_FILESYSTEM #define HAS_STD_FILESYSTEM
#endif #endif
@ -88,9 +88,7 @@ static std::vector<std::string> ReadM3UFile(const std::string& m3u_path,
if (!line.empty() && line.front() != '#') // Comments start with # if (!line.empty() && line.front() != '#') // Comments start with #
{ {
#ifdef HAS_STD_FILESYSTEM #ifdef HAS_STD_FILESYSTEM
const fs::path path_line = fs::u8path(line); const std::string path_to_add = (fs::u8path(folder_path) / fs::u8path(line)).u8string();
const std::string path_to_add =
path_line.is_relative() ? fs::u8path(folder_path).append(path_line).u8string() : line;
#else #else
const std::string path_to_add = line.front() != '/' ? folder_path + line : line; const std::string path_to_add = line.front() != '/' ? folder_path + line : line;
#endif #endif