Skip to content

Commit

Permalink
Support clang and std::filesystem (#390)
Browse files Browse the repository at this point in the history
* Support clang and std::filesystem

Signed-off-by: Nate Koenig <[email protected]>

* A bit cleaner

Signed-off-by: Nate Koenig <[email protected]>

---------

Signed-off-by: Nate Koenig <[email protected]>
  • Loading branch information
nkoenig authored Mar 16, 2023
1 parent d52aa70 commit 559ba5a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
#endif

#ifndef __APPLE__
#if __unix__ && __GNUC__ < 8
#if ((defined(__clang__) && __cplusplus < 201703L) || \
(__unix__ && __GNUC__ < 8))
#define GZ_EXPERIMENTAL_FILESYSTEM
#endif

#ifdef GZ_EXPERIMENTAL_FILESYSTEM
#include <experimental/filesystem>
#else
#include <filesystem>
Expand Down Expand Up @@ -98,7 +103,7 @@ namespace testing
// Ugly as hell but trying to avoid boost::filesystem
return _str1 + "/" + _str2;
#else
#if __unix__ && __GNUC__ < 8
#ifdef GZ_EXPERIMENTAL_FILESYSTEM
using namespace std::experimental::filesystem;
#else
using namespace std::filesystem;
Expand Down

0 comments on commit 559ba5a

Please sign in to comment.