MINOR: threads: Use __decl_hathreads to declare locks

This macro should be used to declare variables or struct members depending on
the USE_THREAD compile option. It avoids the encapsulation of such declarations
between #ifdef/#endif. It is used to declare all lock variables.
diff --git a/include/common/buffer.h b/include/common/buffer.h
index acaa79a..4216d93 100644
--- a/include/common/buffer.h
+++ b/include/common/buffer.h
@@ -52,9 +52,7 @@
 extern struct buffer buf_empty;
 extern struct buffer buf_wanted;
 extern struct list buffer_wq;
-#ifdef USE_THREAD
-extern HA_SPINLOCK_T buffer_wq_lock;
-#endif
+__decl_hathreads(HA_SPINLOCK_T buffer_wq_lock);
 
 int init_buffer();
 void deinit_buffer();
diff --git a/include/common/hathreads.h b/include/common/hathreads.h
index 3b8fb0b..31d0f53 100644
--- a/include/common/hathreads.h
+++ b/include/common/hathreads.h
@@ -30,6 +30,8 @@
 
 #ifndef USE_THREAD
 
+#define __decl_hathreads(decl)
+
 #define HA_ATOMIC_CAS(val, old, new) ({((*val) == (*old)) ? (*(val) = (new) , 1) : (*(old) = *(val), 0);})
 #define HA_ATOMIC_ADD(val, i)        ({*(val) += (i);})
 #define HA_ATOMIC_SUB(val, i)        ({*(val) -= (i);})
@@ -93,6 +95,8 @@
 #include <pthread.h>
 #include <import/plock.h>
 
+#define __decl_hathreads(decl) decl
+
 /* TODO: thread: For now, we rely on GCC builtins but it could be a good idea to
  * have a header file regrouping all functions dealing with threads. */
 #define HA_ATOMIC_CAS(val, old, new) __atomic_compare_exchange_n(val, old, new, 0, 0, 0)
diff --git a/include/common/memory.h b/include/common/memory.h
index ee394f8..a5c0ec4 100644
--- a/include/common/memory.h
+++ b/include/common/memory.h
@@ -47,9 +47,7 @@
 
 struct pool_head {
 	void **free_list;
-#ifdef USE_THREAD
-	HA_SPINLOCK_T lock;     /* the spin lock */
-#endif
+	__decl_hathreads(HA_SPINLOCK_T lock); /* the spin lock */
 	struct list list;	/* list of all known pools */
 	unsigned int used;	/* how many chunks are currently in use */
 	unsigned int allocated;	/* how many chunks have been allocated */