From: Paul Brossier Date: Sun, 12 Mar 2017 16:21:51 +0000 (+0100) Subject: src/aubio_setup.c: use HAVE_PTHREAD_H X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=de7285af32dd4e393d6759e0cfb52b7c37193b35;p=pd-aubio.git src/aubio_setup.c: use HAVE_PTHREAD_H --- diff --git a/src/aubio_setup.c b/src/aubio_setup.c index b932688..64e4b82 100644 --- a/src/aubio_setup.c +++ b/src/aubio_setup.c @@ -3,7 +3,7 @@ #include #include -#ifdef HAVE_PTHREAD +#ifdef HAVE_PTHREAD_H #include pthread_mutex_t aubio_log_mutex; #else @@ -43,7 +43,7 @@ void aubio_custom_log(int level, const char *message, void *data) if ((pos=strchr(message, '\n')) != NULL) { *pos = '\0'; } -#ifdef HAVE_PTHREAD +#ifdef HAVE_PTHREAD_H pthread_mutex_lock(&aubio_log_mutex); #endif if (level == AUBIO_LOG_ERR) { @@ -53,7 +53,7 @@ void aubio_custom_log(int level, const char *message, void *data) } else { post(message); } -#ifdef HAVE_PTHREAD +#ifdef HAVE_PTHREAD_H pthread_mutex_unlock(&aubio_log_mutex); #endif } @@ -61,7 +61,7 @@ void aubio_custom_log(int level, const char *message, void *data) void aubio_setup (void) { // register custom log function for errors and warnings -#ifdef HAVE_PTHREAD +#ifdef HAVE_PTHREAD_H pthread_mutex_init(&aubio_log_mutex, 0); #endif aubio_log_set_function(aubio_custom_log, NULL); diff --git a/wscript b/wscript index c3ee7e7..1486ebc 100644 --- a/wscript +++ b/wscript @@ -47,7 +47,7 @@ def configure(ctx): ctx.check(header_name='m_pd.h') ctx.check(header_name='pthread.h', mandatory = False) - needs_pthread = ctx.get_define("HAVE_PTHREAD") is not None + needs_pthread = ctx.get_define("HAVE_PTHREAD_H") is not None if needs_pthread: ctx.check_cc(lib="pthread", uselib_store="PTHREAD", mandatory=needs_pthread)