Skip to content

Commit 7261a14

Browse files
authored
fix: conditional c++ filesystem include (#3097)
1 parent 76e846a commit 7261a14

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

duckdb-vortex/src/vortex_scan.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
#include "duckdb/main/extension_util.hpp"
88
#include "vortex_extension.hpp"
99

10-
#include <filesystem>
10+
#if __has_include(<filesystem>)
11+
#include <filesystem>
12+
namespace fs = std::filesystem;
13+
#elif __has_include(<experimental/filesystem>)
14+
#include <experimental/filesystem>
15+
namespace fs = std::experimental::filesystem;
16+
#else
17+
#error "No filesystem support available"
18+
#endif
1119

1220
#include "vortex_common.hpp"
1321
#include "expr/expr.hpp"
@@ -154,7 +162,7 @@ std::string EnsureFileProtocol(const std::string &path) {
154162
auto absolute_path = path;
155163
const std::string prefix = "file://";
156164

157-
std::filesystem::path p = absolute_path;
165+
fs::path p = absolute_path;
158166
if (!p.is_absolute()) {
159167
try {
160168
absolute_path = absolute(p).string();

0 commit comments

Comments
 (0)