From 7dfd0b71ee8d1c8409d2f09ad3ccfcb467f16d6b Mon Sep 17 00:00:00 2001 From: Gilles Talis Date: Sun, 26 May 2013 12:08:18 +0400 Subject: Enable build using toolchain without pthreads * src/atomic_ops.c: Include pthread.h only if not AO_NO_PTHREADS (new macro). * src/atomic_ops.c (AO_pt_lock): Define only unless AO_NO_PTHREADS. * tests/test_atomic.c (main): Skip test_atomic_pthreads if both AO_NO_PTHREADS and AO_USE_PTHREAD_DEFS are defined (preventing test link failure if AO_NO_PTHREADS passed via CFLAGS). --- tests/test_atomic.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/test_atomic.c') diff --git a/tests/test_atomic.c b/tests/test_atomic.c index 6ce690a..980fb6b 100644 --- a/tests/test_atomic.c +++ b/tests/test_atomic.c @@ -15,6 +15,16 @@ # include "config.h" #endif +#if defined(AO_NO_PTHREADS) && defined(AO_USE_PTHREAD_DEFS) +# include + + int main(void) + { + printf("test skipped\n"); + return 0; + } + +#else #include "run_parallel.h" @@ -190,3 +200,5 @@ int main(void) # endif return 0; } + +#endif /* !AO_NO_PTHREADS || !AO_USE_PTHREAD_DEFS */ -- cgit v1.2.1