summaryrefslogtreecommitdiffstats
path: root/package/libatomic_ops/libatomic_ops-nothread-build-failure-fix.patch
blob: cc14b1e2e98dfbb23f54a880689ee1f7cbfc4ee6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From 7e940ce34ff4de254d460344f1a1a486a14fb045 Mon Sep 17 00:00:00 2001
From: Gilles Talis <gilles.talis@gmail.com>
Date: Wed, 22 May 2013 16:21:26 -0700
Subject: [PATCH] Fix build failure seen when using toolchain without threads support

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
---
 src/atomic_ops.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/atomic_ops.c b/src/atomic_ops.c
index b6731a2..5769643 100644
--- a/src/atomic_ops.c
+++ b/src/atomic_ops.c
@@ -48,7 +48,9 @@
 
 #undef AO_REQUIRE_CAS
 
+#if defined(AO_USE_PTHREAD_DEFS)
 #include <pthread.h>
+#endif
 
 #ifndef AO_USE_NO_SIGNALS
 # include <signal.h>
@@ -72,11 +74,13 @@
 # include "atomic_ops/sysdeps/standard_ao_double_t.h"
 #endif
 
+#if defined(AO_USE_PTHREAD_DEFS)
 /*
  * Lock for pthreads-based implementation.
  */
 
 pthread_mutex_t AO_pt_lock = PTHREAD_MUTEX_INITIALIZER;
+#endif
 
 /*
  * Out of line compare-and-swap emulation based on test and set.
-- 
1.7.4.1