[Pkg-gnupg-commit] [libgpg-error] 08/15: Fix build without threads
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Jul 14 23:49:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository libgpg-error.
commit abcdfa7964da62b92984516608faf8941038b71d
Author: Yann E. MORIN <yann.morin.1998 at free.fr>
Date: Sun Jul 10 11:38:46 2016 +0200
Fix build without threads
* src/gen-posix-lock-obj.c: properly guard inclusioin of pthread.h
* tests/t-lock.c: likewise
* tests/t-poll.c: likewise
--
Although ./configure checks for thread support, gen-posix-lock-obj and
two tests still include 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 +++-
tests/t-lock.c | 4 +++-
tests/t-poll.c | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
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"
diff --git a/tests/t-lock.c b/tests/t-lock.c
index 38c9cec..6add18b 100644
--- a/tests/t-lock.c
+++ b/tests/t-lock.c
@@ -31,7 +31,9 @@
# include <windows.h>
# include <time.h>
#else
-# include <pthread.h>
+# ifdef USE_POSIX_THREADS
+# include <pthread.h>
+# endif
#endif
#define PGM "t-lock"
diff --git a/tests/t-poll.c b/tests/t-poll.c
index 811f895..a26cbfa 100644
--- a/tests/t-poll.c
+++ b/tests/t-poll.c
@@ -34,7 +34,9 @@
# include <windows.h>
# include <time.h>
#else
-# include <pthread.h>
+# ifdef USE_POSIX_THREADS
+# include <pthread.h>
+# endif
#endif
#define PGM "t-lock"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libgpg-error.git
More information about the Pkg-gnupg-commit
mailing list