fix macos build

This commit is contained in:
MihailRis 2026-10-11 20:54:06 +03:00
parent af5ccae796
commit f48176adcd

View file

@ -28,6 +28,8 @@
#endif #endif
#ifdef __linux__ #ifdef __linux__
#include <sys/prctl.h> #include <sys/prctl.h>
#endif
#if defined(__linux__) || defined(__APPLE__)
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
@ -222,7 +224,7 @@ std::filesystem::path platform::get_executable_path() {
class SystemProcessImpl final : public SystemProcess { class SystemProcessImpl final : public SystemProcess {
public: public:
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
SystemProcessImpl( SystemProcessImpl(
pid_t pid, int stdinDescriptor = -1, int stdoutDescriptor = -1 pid_t pid, int stdinDescriptor = -1, int stdoutDescriptor = -1
) )
@ -259,7 +261,7 @@ public:
SystemProcessImpl& operator=(SystemProcessImpl&& other) noexcept { SystemProcessImpl& operator=(SystemProcessImpl&& other) noexcept {
if (this != &other) { if (this != &other) {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
pid = other.pid; pid = other.pid;
#elif defined(_WIN32) #elif defined(_WIN32)
if (processHandle != nullptr) { if (processHandle != nullptr) {
@ -279,7 +281,7 @@ public:
} }
bool isActive() const override { bool isActive() const override {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
if (pid <= 0) { if (pid <= 0) {
return false; return false;
} }
@ -319,7 +321,7 @@ public:
void update() override {} void update() override {}
void waitForEnd() override { void waitForEnd() override {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
if (pid <= 0) { if (pid <= 0) {
return; return;
} }
@ -333,7 +335,7 @@ public:
}; };
void terminate() final override { void terminate() final override {
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
if (pid <= 0) { if (pid <= 0) {
return; return;
} }
@ -356,7 +358,7 @@ public:
} }
private: private:
#ifdef __linux__ #if defined(__linux__) || defined(__APPLE__)
pid_t pid; pid_t pid;
int stdinDescriptor; int stdinDescriptor;
int stdoutDescriptor; int stdoutDescriptor;