From 220e6b66e86f7d69f894e25077d62e10bd43ad7f Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Mon, 13 Aug 2018 11:49:52 +0200 Subject: [PATCH] threads: use static error check mutex initializer if available This changes the condition to use the static error check mutex initializer. If it is not available, use the default static mutex initializer. Signed-off-by: Anderson Toshiyuki Sasaki Reviewed-by: Andreas Schneider (cherry picked from commit 0be1ae0e3b1e1467180c7548f55154109bfb83d2) --- include/libssh/threads.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libssh/threads.h b/include/libssh/threads.h index e8ccf7be..522f91d5 100644 --- a/include/libssh/threads.h +++ b/include/libssh/threads.h @@ -29,7 +29,7 @@ #include #define SSH_MUTEX pthread_mutex_t -#if defined _GNU_SOURCE +#if defined(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP) #define SSH_MUTEX_STATIC_INIT PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP #else #define SSH_MUTEX_STATIC_INIT PTHREAD_MUTEX_INITIALIZER