From 98ad7dd049a366e21d60a34548736a3c8ef72877 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 30 Dec 2017 04:32:49 +0100 Subject: Add support for windows (ugly fast solution) --- src/Conf.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Conf.cpp') diff --git a/src/Conf.cpp b/src/Conf.cpp index d6aee2c..743942a 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -1,5 +1,5 @@ #include "../include/Conf.hpp" -#include "../include/FileUtil.hpp" +#include "../include/types.hpp" #include "../external/utf8/unchecked.h" using namespace std; @@ -7,8 +7,6 @@ using u8string = utf8::unchecked::iterator; namespace sibs { - u32 min(u32 a, u32 b) { return a < b ? a : b; } - class UnexpectedTokenException : public std::runtime_error { public: @@ -316,7 +314,7 @@ namespace sibs bool objectDefined; }; - Result Config::readFromFile(const char *filepath, const ConfigCallback &callback) + Result Config::readFromFile(const _tinydir_char_t *filepath, const ConfigCallback &callback) { Result fileContentResult = getFileContent(filepath); if(fileContentResult.isErr()) @@ -409,9 +407,13 @@ namespace sibs if (value.isSingle()) { testPath = projectPath; - testPath += "/"; - testPath += string(value.asSingle().data, value.asSingle().size); - Result testRealPathResult = getRealPath(testPath.c_str()); + testPath += TINYDIR_STRING("/"); +#if OS_FAMILY == OS_FAMILY_POSIX + testPath += FileString(value.asSingle().data, value.asSingle().size); +#else + testPath += utf8To16(value.asSingle()); +#endif + Result testRealPathResult = getRealPath(testPath.c_str()); if(!testRealPathResult) { string errMsg = "Failed to resolve package.tests path: "; -- cgit v1.2.3