From e7ebd55c31148089eb54ffbd708216c1c7cb09ff Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 29 Sep 2018 22:03:50 +0200 Subject: Add support for macos --- src/Conf.cpp | 12 +++++++++++- src/FileUtil.cpp | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Conf.cpp b/src/Conf.cpp index bad3c01..6645913 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -532,6 +532,8 @@ namespace sibs case PLATFORM_LINUX64: return "linux64"; case PLATFORM_WIN32: return "win32"; case PLATFORM_WIN64: return "win64"; + case PLATFORM_MACOS32: return "macos32"; + case PLATFORM_MACOS64: return "macos64"; default: return nullptr; } } @@ -801,11 +803,19 @@ namespace sibs { platforms.push_back(PLATFORM_WIN64); } + else if (platform.equals("macos32")) + { + platforms.push_back(PLATFORM_MACOS32); + } + else if (platform.equals("macos64")) + { + platforms.push_back(PLATFORM_MACOS64); + } else { string errMsg = "package.platforms contains invalid platform \""; errMsg += string(platform.data, platform.size); - errMsg += "\". Expected platform to be one of: any, linux32, linux64, win32 or win64"; + errMsg += "\". Expected platform to be one of: any, linux32, linux64, win32, win64, macos32 or macos64"; throw ParserException(errMsg); } } diff --git a/src/FileUtil.cpp b/src/FileUtil.cpp index 222edbb..e3d4c3c 100644 --- a/src/FileUtil.cpp +++ b/src/FileUtil.cpp @@ -129,7 +129,7 @@ namespace sibs { struct stat64 fileStat; if (stat64(path, &fileStat) == 0) - return Result::Ok(fileStat.st_mtim.tv_sec); + return Result::Ok(fileStat.st_mtime); else { string errMsg = "File not found: "; -- cgit v1.2.3