Skip to content

Commit 901f7e8

Browse files
committed
Use std::filesystem::path::preferred_separator. NFC
1 parent f1a1496 commit 901f7e8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/support/path.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
// Command line helpers.
1919
//
2020

21+
#include <filesystem>
22+
2123
#include "support/path.h"
2224
#ifdef USE_WSTRING_PATHS
2325
#include "windows.h"
@@ -53,13 +55,7 @@ PathString to_path(const std::string& s) { return s; }
5355
#endif
5456

5557
char getPathSeparator() {
56-
// TODO: use c++17's path separator
57-
// http://en.cppreference.com/w/cpp/experimental/fs/path
58-
#if defined(WIN32) || defined(_WIN32)
59-
return '\\';
60-
#else
61-
return '/';
62-
#endif
58+
return std::filesystem::path::preferred_separator;
6359
}
6460

6561
static std::string getAllPathSeparators() {

0 commit comments

Comments
 (0)