]> granicus.if.org Git - libatomic_ops/commitdiff
Fix compiler warning in atomic_ops.c (define 'init_lock' only if used)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 21 Oct 2011 11:32:19 +0000 (15:32 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 21 Oct 2011 12:15:28 +0000 (16:15 +0400)
* src/atomic_ops.c (init_lock): Define only unless AO_USE_NO_SIGNALS.

src/atomic_ops.c

index c46e2d1de509c08729bcb0884959dce211339362..b6731a298250749883ab37448efffe86ee8d565e 100644 (file)
@@ -162,10 +162,9 @@ AO_INLINE void unlock(volatile AO_TS_t *l)
 #ifndef AO_USE_NO_SIGNALS
   static sigset_t all_sigs;
   static volatile AO_t initialized = 0;
+  static volatile AO_TS_t init_lock = AO_TS_INITIALIZER;
 #endif
 
-static volatile AO_TS_t init_lock = AO_TS_INITIALIZER;
-
 int AO_compare_and_swap_emulation(volatile AO_t *addr, AO_t old,
                                   AO_t new_val)
 {