]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] add support for variable size arrays in structures
authorWilly Tarreau <w@1wt.eu>
Sun, 6 May 2007 22:19:57 +0000 (00:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2007 12:08:05 +0000 (14:08 +0200)
Depending on the version of GCC, variable size arrays are not
declared in the same manner. Let's add a check for the version
and provide a macro.

include/common/compat.h

index 8261f8f9820ac0f4cf5bf8e451f31c4630a72b81..1bfe669ab40533325e8bc3389be62ae59a63fb0f 100644 (file)
 #ifndef _COMMON_COMPAT_H
 #define _COMMON_COMPAT_H
 
+/*
+ * Gcc before 3.0 needs [0] to declare a variable-size array
+ */
+#if  __GNUC__  < 3
+#define VAR_ARRAY      0
+#else
+#define VAR_ARRAY
+#endif
+
 /* This is needed on Linux for Netfilter includes */
 #include <sys/socket.h>
 #include <common/config.h>