[libgpg-error PATCH 2/3] tests: fix build without threads
Yann E. MORIN
yann.morin.1998 at free.fr
Sat Jul 9 14:05:38 CEST 2016
Although ./configure checks for thread support, some 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>
---
tests/t-lock.c | 4 +++-
tests/t-poll.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
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"
--
2.7.4
More information about the Gnupg-devel
mailing list