aboutsummaryrefslogtreecommitdiffstats
path: root/src/zix/sem.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zix/sem.h')
-rw-r--r--src/zix/sem.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/zix/sem.h b/src/zix/sem.h
index e306052..faeb148 100644
--- a/src/zix/sem.h
+++ b/src/zix/sem.h
@@ -25,14 +25,16 @@
# include <limits.h>
# include <windows.h>
#else
-# include <semaphore.h>
# include <errno.h>
+# include <semaphore.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
+#include <stdbool.h>
+
/**
@addtogroup zix
@{
@@ -40,6 +42,8 @@ extern "C" {
@{
*/
+struct ZixSemImpl;
+
/**
A counting semaphore.
@@ -148,7 +152,7 @@ static inline ZixStatus
zix_sem_init(ZixSem* sem, unsigned initial)
{
sem->sem = CreateSemaphore(NULL, initial, LONG_MAX, NULL);
- return (sem->sem) ? ZIX_STATUS_ERROR : ZIX_STATUS_SUCCESS;
+ return (sem->sem) ? ZIX_STATUS_SUCCESS : ZIX_STATUS_ERROR;
}
static inline void