From 657eac0c692555d33cdcb6aeb236a2ee42d20a07 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 13 Sep 2023 11:29:20 +0200 Subject: [PATCH] system: add PATH_SEPARATOR I am aware of the std::filesystem::path::preferred_separator, but we are targeting C++14 and we need this as a precompiler macro to allow concatenation of the path strings in precompile stage. Signed-off-by: Simon Rozman --- include/stdex/system.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/stdex/system.hpp b/include/stdex/system.hpp index 713bbbb1f..51e2d13fc 100644 --- a/include/stdex/system.hpp +++ b/include/stdex/system.hpp @@ -31,6 +31,14 @@ #endif #endif +#if defined(_WIN32) +#define PATH_SEPARATOR '\\' +#define PATH_SEPARATOR_STR "\\" +#else +#define PATH_SEPARATOR '/' +#define PATH_SEPARATOR_STR "/" +#endif + namespace stdex { ///