diff --git a/src/app/interprocesscommunicator.cpp b/src/app/interprocesscommunicator.cpp index 5968cf1..af602e7 100644 --- a/src/app/interprocesscommunicator.cpp +++ b/src/app/interprocesscommunicator.cpp @@ -1,5 +1,6 @@ #include "app/interprocesscommunicator.h" #include +#include #include #include "helpers/stringhelpers.h" #ifndef _WIN32 diff --git a/src/filesystem/filesystemwatcher.cpp b/src/filesystem/filesystemwatcher.cpp index 9078631..b43aa69 100644 --- a/src/filesystem/filesystemwatcher.cpp +++ b/src/filesystem/filesystemwatcher.cpp @@ -7,6 +7,17 @@ #include #endif +#ifdef __APPLE__ +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + // Only available in 10.7+ + #define kFSEventStreamCreateFlagFileEvents 0x00000010 + #define kFSEventStreamEventFlagItemCreated 0x00000100 + #define kFSEventStreamEventFlagItemRemoved 0x00000200 + #define kFSEventStreamEventFlagItemRenamed 0x00000800 +#endif +#endif + namespace Nickvision::Filesystem { FileSystemWatcher::FileSystemWatcher(const std::filesystem::path& path, bool incudeSubdirectories, WatcherFlags watcherFlags) diff --git a/src/system/suspendinhibitor.cpp b/src/system/suspendinhibitor.cpp index 23a6611..ed1b279 100644 --- a/src/system/suspendinhibitor.cpp +++ b/src/system/suspendinhibitor.cpp @@ -3,6 +3,8 @@ #include #elif defined(__linux__) #include +#elif defined(__APPLE__) +#include #endif namespace Nickvision::System @@ -77,11 +79,15 @@ namespace Nickvision::System g_variant_unref(result); g_object_unref(proxy); #elif defined(__APPLE__) + #if MAC_OS_X_VERSION_MIN_REQUIRED > 1060 IOReturn result{ IOPMAssertionCreateWithName(kIOPMAssertionTypePreventUserIdleSystemSleep, kIOPMAssertionLevelOn, CFSTR("Nickvision preventing suspend"), &m_cookie) }; if(result != kIOReturnSuccess) { return false; } + #else + return false; + #endif #endif m_inhibiting = true; return true;