Build: Allow compilation on older compilers (experimental filesystem namespace)

This commit is contained in:
Sour 2020-02-07 18:27:01 -05:00
parent 5101ad4d05
commit 0dec581233
2 changed files with 14 additions and 7 deletions

View File

@ -1,11 +1,15 @@
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <filesystem>
#if __has_include(<filesystem>)
#include <filesystem>
namespace fs = std::filesystem;
#elif __has_include(<experimental/filesystem>)
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#endif
namespace fs = std::filesystem;
using std::string;
using std::vector;

View File

@ -1,10 +1,13 @@
#include "stdafx.h"
//TODO: Use non-experimental namespace (once it is officially supported by VC & GCC)
#ifndef LIBRETRO
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <filesystem>
namespace fs = std::filesystem;
#if __has_include(<filesystem>)
#include <filesystem>
namespace fs = std::filesystem;
#elif __has_include(<experimental/filesystem>)
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#endif
#endif
#include <unordered_set>