Skip to content

Commit

Permalink
libfreerdp-chanman: make semaphore macros use the platform-indipenden…
Browse files Browse the repository at this point in the history
…t semaphore functions.

Fixes Mac OS X compatibility.
  • Loading branch information
Dorian Johnson committed Jul 3, 2011
1 parent ddb612c commit 318b256
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions libfreerdp-chanman/libchanman.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#else
#include <dlfcn.h>
#include <semaphore.h>
#include <freerdp/utils/semaphore.h>
#include <netdb.h>
#include <unistd.h>
#include <pthread.h>
Expand All @@ -65,10 +66,10 @@
#define MUTEX_UNLOCK(m) pthread_mutex_unlock(&m)
#define MUTEX_DESTROY(m) pthread_mutex_destroy(&m)
#define SEMAPHORE sem_t
#define SEMAPHORE_INIT(s, i, m) sem_init(&s, i, m)
#define SEMAPHORE_WAIT(s) sem_wait(&s)
#define SEMAPHORE_POST(s) sem_post(&s)
#define SEMAPHORE_DESTROY(s) sem_destroy(&s)
#define SEMAPHORE_INIT(s, m) freerdp_sem_create(&(s), (m))
#define SEMAPHORE_WAIT(s) freerdp_sem_wait(&(s))
#define SEMAPHORE_POST(s) freerdp_sem_signal(&(s))
#define SEMAPHORE_DESTROY(s) freerdp_sem_destroy(&(s))
#define CHR char
#define DLOPEN(f) dlopen(f, RTLD_LOCAL | RTLD_LAZY)
#define DLSYM(f, n) dlsym(f, n)
Expand Down Expand Up @@ -652,8 +653,8 @@ freerdp_chanman_new(void)
chan_man = (rdpChanMan *) malloc(sizeof(rdpChanMan));
memset(chan_man, 0, sizeof(rdpChanMan));

SEMAPHORE_INIT(chan_man->sem, 0, 1); /* start at 1 */
SEMAPHORE_INIT(chan_man->sem_event, 0, 1); /* start at 1 */
SEMAPHORE_INIT(chan_man->sem,1); /* start at 1 */
SEMAPHORE_INIT(chan_man->sem_event, 1); /* start at 1 */
#ifdef _WIN32
chan_man->chan_event = CreateEvent(NULL, TRUE, FALSE, NULL);
#else
Expand Down

0 comments on commit 318b256

Please sign in to comment.