V1.24 Attempted std::filesystem fix
Also double checked Code::Blocks build. All good. Checked VS2017 with C++14 & C++17, also VS2019 with C++14 & C++17. All good.
This commit is contained in:
parent
2ca6db0ccd
commit
85d0d425da
@ -2,7 +2,7 @@
|
|||||||
olcPixelGameEngine.h
|
olcPixelGameEngine.h
|
||||||
|
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
| OneLoneCoder Pixel Game Engine v1.23 |
|
| OneLoneCoder Pixel Game Engine v1.24 |
|
||||||
| "Like the command prompt console one, but not..." - javidx9 |
|
| "Like the command prompt console one, but not..." - javidx9 |
|
||||||
+-------------------------------------------------------------+
|
+-------------------------------------------------------------+
|
||||||
|
|
||||||
@ -246,30 +246,31 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#define USE_EXPERIMENTAL_FS
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#if _MSVC_LANG >= 201703L // Thanks @slavka
|
#if _MSC_VER >= 1920 && _MSVC_LANG >= 201703L
|
||||||
// C++17 onwards
|
#undef USE_EXPERIMENTAL_FS
|
||||||
#include <filesystem>
|
|
||||||
namespace _gfs = std::filesystem;
|
|
||||||
#else
|
|
||||||
// Older "Modern" C++ :P
|
|
||||||
#include <experimental/filesystem>
|
|
||||||
namespace _gfs = std::experimental::filesystem::v1;
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__) || defined(__MINGW32__)
|
#if defined(__linux__) || defined(__MINGW32__) || defined(__EMSCRIPTEN__)
|
||||||
#if __cplusplus >= 201703L
|
#if __cplusplus >= 201703L
|
||||||
// C++17 onwards
|
#undef USE_EXPERIMENTAL_FS
|
||||||
#include <filesystem>
|
|
||||||
namespace _gfs = std::filesystem;
|
|
||||||
#else
|
|
||||||
// Older "Modern" C++ :P
|
|
||||||
#include <experimental/filesystem>
|
|
||||||
namespace _gfs = std::experimental::filesystem::v1;
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(USE_EXPERIMENTAL_FS)
|
||||||
|
// C++14
|
||||||
|
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
|
||||||
|
#include <experimental/filesystem>
|
||||||
|
namespace _gfs = std::experimental::filesystem::v1;
|
||||||
|
#else
|
||||||
|
// C++17
|
||||||
|
#include <filesystem>
|
||||||
|
namespace _gfs = std::filesystem;
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef min
|
#undef min
|
||||||
#undef max
|
#undef max
|
||||||
#define UNUSED(x) (void)(x)
|
#define UNUSED(x) (void)(x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user