Fix marco definition

master
Kirigaya Kazuto 2017-12-27 12:01:13 +08:00
parent 96a42cdfda
commit bc07174c0e
3 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,5 @@
#ifdef __linux__ /// Linux
#if (defined(__linux__)&&!defined(_TRY_POSIX)) /// Linux platform without trying posix.
#include "SemaphoreWrapper.h"
#include <fcntl.h>

View File

@ -1,4 +1,4 @@
#if (!defined(_WIN32)&&!defined(__linux__)) /// Not Windows or linux... Try posix.
#ifdef _TRY_POSIX /// Try posix.
#include "SemaphoreWrapper.h"
#include <fcntl.h>
@ -42,6 +42,7 @@ ProcessSemaphore::ProcessSemaphore(int key, int action, int default_value) : _p(
}
else
{
/// Notice: Most platform reports "Function not implemented" on sem_open.
dprintf("Failed to sem_open. %s\n",strerror(errno));
}
}
@ -86,4 +87,4 @@ int ProcessSemaphore::notify()
return v();
}
#endif
#endif /// End of Try Posix

View File

@ -1,4 +1,4 @@
#ifdef _WIN32
#if (defined(_WIN32)&&!defined(_TRY_POSIX)) /// Windows platform without trying posix.
#include "SemaphoreWrapper.h"
#include <windows.h>