src/aubio_setup.c: use HAVE_PTHREAD_H
authorPaul Brossier <piem@piem.org>
Sun, 12 Mar 2017 16:21:51 +0000 (17:21 +0100)
committerPaul Brossier <piem@piem.org>
Sun, 12 Mar 2017 16:21:51 +0000 (17:21 +0100)
src/aubio_setup.c
wscript

index b932688..64e4b82 100644 (file)
@@ -3,7 +3,7 @@
 #include <aubio/aubio.h>
 #include <string.h>
 
-#ifdef HAVE_PTHREAD
+#ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 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 (file)
--- 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)