fix windows compilation (2) (#1411)

* fix windows compialtion (2)

* loader: guard LoadExec close_range path with __linux__ for macOS

---------

Co-authored-by: ReverendOzmund <catmilker@proton.me>
This commit is contained in:
nmzik
2026-10-11 11:11:02 +02:00
committed by GitHub
parent 6f0cddd440
commit 16a7fe689a
3 changed files with 9 additions and 4 deletions
+2 -2
View File
@@ -14,7 +14,7 @@
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#elif KYTY_PLATFORM == KYTY_PLATFORM_LINUX
#elif defined(__linux__)
#include <linux/close_range.h>
#include <unistd.h>
#endif
@@ -45,7 +45,7 @@ int LoadExec(const char* path, const char* const argv[]) {
!Common::File::IsFileExisting(Libs::LibKernel::FileSystem::GetRealFilename(path))) {
return SYSTEM_SERVICE_ERROR_PARAMETER;
}
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS || KYTY_PLATFORM == KYTY_PLATFORM_LINUX
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS || defined(__linux__)
std::vector<std::string> arguments {"--guest-exec", path};
size_t bytes = 0;
for (size_t i = 0; argv != nullptr && argv[i] != nullptr; ++i) {