[CLEANUP] included common/version.h everywhere
diff --git a/include/common/appsession.h b/include/common/appsession.h
index 2c39e46..eb9ba2d 100644
--- a/include/common/appsession.h
+++ b/include/common/appsession.h
@@ -7,6 +7,7 @@
#include <sys/time.h>
#include <common/chtbl.h>
+#include <common/config.h>
#include <common/hashpjw.h>
#include <common/list.h>
diff --git a/include/common/base64.h b/include/common/base64.h
index 3948962..bd77c68 100644
--- a/include/common/base64.h
+++ b/include/common/base64.h
@@ -14,6 +14,8 @@
#ifndef _COMMON_BASE64_H
#define _COMMON_BASE64_H
+#include <common/config.h>
+
int a2base64(char *in, int ilen, char *out, int olen);
extern const char base64tab[];
diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h
index 35302b3..591f172 100644
--- a/include/common/cfgparse.h
+++ b/include/common/cfgparse.h
@@ -22,6 +22,8 @@
#ifndef _COMMON_CFGPARSE_H
#define _COMMON_CFGPARSE_H
+#include <common/config.h>
+
/* configuration sections */
#define CFG_NONE 0
#define CFG_GLOBAL 1
diff --git a/include/common/chtbl.h b/include/common/chtbl.h
index 38b495f..cddb207 100644
--- a/include/common/chtbl.h
+++ b/include/common/chtbl.h
@@ -20,7 +20,8 @@
#include <stdlib.h>
-#include "list.h"
+#include <common/config.h>
+#include <common/list.h>
/*****************************************************************************
* *
diff --git a/include/common/compat.h b/include/common/compat.h
index a605da1..58908d7 100644
--- a/include/common/compat.h
+++ b/include/common/compat.h
@@ -24,6 +24,7 @@
/* This is needed on Linux for Netfilter includes */
#include <sys/socket.h>
+#include <common/config.h>
/* INTBITS
* how many bits are needed to code the size of an int on the target platform.
diff --git a/include/common/config.h b/include/common/config.h
index f9145c5..c1cf098 100644
--- a/include/common/config.h
+++ b/include/common/config.h
@@ -31,4 +31,13 @@
*/
#define SCHEDULER_RESOLUTION 9
+/* CONFIG_HAP_MEM_OPTIM
+ * This enables use of memory pools instead of malloc()/free(). There
+ * is no reason to disable it, except perhaps for rare debugging.
+ */
+#ifndef CONFIG_HAP_NO_MEM_OPTIM
+# define CONFIG_HAP_MEM_OPTIM
+#endif /* CONFIG_HAP_NO_MEM_OPTIM */
+
+
#endif /* _COMMON_CONFIG_H */
diff --git a/include/common/defaults.h b/include/common/defaults.h
index 449fc5f..e44a64c 100644
--- a/include/common/defaults.h
+++ b/include/common/defaults.h
@@ -22,15 +22,6 @@
#ifndef _COMMON_DEFAULTS_H
#define _COMMON_DEFAULTS_H
-
-/* CONFIG_HAP_MEM_OPTIM
- * This enables use of memory pools instead of malloc()/free(). There
- * is no reason to disable it, except perhaps for rare debugging.
- */
-#ifndef CONFIG_HAP_NO_MEM_OPTIM
-# define CONFIG_HAP_MEM_OPTIM
-#endif /* CONFIG_HAP_NO_MEM_OPTIM */
-
/*
* BUFSIZE defines the size of a read and write buffer. It is the maximum
* amount of bytes which can be stored by the proxy for each session. However,
diff --git a/include/common/epoll.h b/include/common/epoll.h
index 865a3e1..56eef7e 100644
--- a/include/common/epoll.h
+++ b/include/common/epoll.h
@@ -29,8 +29,10 @@
#ifndef _COMMON_EPOLL_H
#define _COMMON_EPOLL_H
-#include <linux/unistd.h>
#include <stdint.h>
+#include <linux/unistd.h>
+
+#include <common/config.h>
/* epoll_ctl() commands */
#ifndef EPOLL_CTL_ADD
diff --git a/include/common/hashpjw.h b/include/common/hashpjw.h
index 99a3ad7..8d3998c 100644
--- a/include/common/hashpjw.h
+++ b/include/common/hashpjw.h
@@ -19,6 +19,8 @@
#ifndef _COMMON_HASHPJW_H
#define _COMMON_HASHPJW_H
+#include <common/config.h>
+
/*****************************************************************************
* *
* Define a table size for demonstration purposes only. *
diff --git a/include/common/list.h b/include/common/list.h
index 4537d8d..91a5084 100644
--- a/include/common/list.h
+++ b/include/common/list.h
@@ -19,6 +19,7 @@
#define _COMMON_LIST_H
#include <stdlib.h>
+#include <common/config.h>
/*****************************************************************************
* *
diff --git a/include/common/mini-clist.h b/include/common/mini-clist.h
index 47b004d..cf472ba 100644
--- a/include/common/mini-clist.h
+++ b/include/common/mini-clist.h
@@ -7,6 +7,8 @@
#ifndef _COMMON_MINI_CLIST_H
#define _COMMON_MINI_CLIST_H
+#include <common/config.h>
+
/* these are circular or bidirectionnal lists only. Each list pointer points to
* another list pointer in a structure, and not the structure itself. The
* pointer to the next element MUST be the first one so that the list is easily
diff --git a/include/common/regex.h b/include/common/regex.h
index d9510bf..c7f1c21 100644
--- a/include/common/regex.h
+++ b/include/common/regex.h
@@ -22,7 +22,7 @@
#ifndef _COMMON_REGEX_H
#define _COMMON_REGEX_H
-#include <common/defaults.h>
+#include <common/config.h>
#ifdef USE_PCRE
#include <pcre.h>
diff --git a/include/common/standard.h b/include/common/standard.h
index bde42e3..0b2ea8d 100644
--- a/include/common/standard.h
+++ b/include/common/standard.h
@@ -23,9 +23,7 @@
#define _COMMON_STANDARD_H
#include <netinet/in.h>
-#include <common/defaults.h>
-#include <common/compat.h>
-
+#include <common/config.h>
/****** string-specific macros and functions ******/
/* if a > max, then bound <a> to <max>. The macro returns the new <a> */
diff --git a/include/common/template.h b/include/common/template.h
index 431274f..c9e48bf 100644
--- a/include/common/template.h
+++ b/include/common/template.h
@@ -22,6 +22,7 @@
#ifndef _COMMON_TEMPLATE_H
#define _COMMON_TEMPLATE_H
+#include <common/config.h>
#endif /* _COMMON_TEMPLATE_H */
diff --git a/include/common/time.h b/include/common/time.h
index b258466..7661aac 100644
--- a/include/common/time.h
+++ b/include/common/time.h
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <sys/time.h>
+#include <common/config.h>
#define TIME_ETERNITY -1
diff --git a/include/common/uri_auth.h b/include/common/uri_auth.h
index ddfa56b..bb25ac1 100644
--- a/include/common/uri_auth.h
+++ b/include/common/uri_auth.h
@@ -12,6 +12,9 @@
#ifndef _COMMON_URI_AUTH_H
#define _COMMON_URI_AUTH_H
+
+#include <common/config.h>
+
/* here we find a very basic list of base64-encoded 'user:passwd' strings */
struct user_auth {
struct user_auth *next; /* next entry, NULL if none */
diff --git a/include/common/version.h b/include/common/version.h
index c1ae43b..14d68a2 100644
--- a/include/common/version.h
+++ b/include/common/version.h
@@ -22,17 +22,23 @@
#ifndef _COMMON_VERSION_H
#define _COMMON_VERSION_H
+#include <common/config.h>
+
#ifdef CONFIG_PRODUCT_NAME
-#define PRODUCT_NAME CONFIG_PRODUCT_NAME
+#define PRODUCT_NAME CONFIG_PRODUCT_NAME
#else
-#define PRODUCT_NAME "HAProxy"
+#define PRODUCT_NAME "HAProxy"
#endif
-#ifndef HAPROXY_VERSION
+#ifdef CONFIG_HAPROXY_VERSION
+#define HAPROXY_VERSION CONFIG_HAPROXY_VERSION
+#else
#define HAPROXY_VERSION "1.3.0"
#endif
-#ifndef HAPROXY_DATE
+#ifdef CONFIG_HAPROXY_DATE
+#define HAPROXY_DATE CONFIG_HAPROXY_DATE
+#else
#define HAPROXY_DATE "2006/06/26"
#endif