[libgpg-error PATCH 1/3] gen-posix-lock-obj: fix build without threads

Yann E. MORIN yann.morin.1998 at free.fr
Sat Jul 9 14:05:37 CEST 2016


Although ./configure checks for thread support, gen-posix-lock-obj still
includes pthread.h unconditionally.

Guard that inclusion using the same condition as all other uses of
pthread-related code.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
---
 src/gen-posix-lock-obj.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
index e32a3cd..e6f33ae 100644
--- a/src/gen-posix-lock-obj.c
+++ b/src/gen-posix-lock-obj.c
@@ -29,7 +29,9 @@
 #include <string.h>
 #include <stdio.h>
 #include <errno.h>
-#include <pthread.h>
+#ifdef USE_POSIX_THREADS
+# include <pthread.h>
+#endif
 
 #include "posix-lock-obj.h"
 
-- 
2.7.4




More information about the Gnupg-devel mailing list