From 3ff3dc1fb15a9b4552a2660b2db108aa090869da Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 7 May 2007 00:19:57 +0200 Subject: [PATCH] [MINOR] add support for variable size arrays in structures 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/common/compat.h b/include/common/compat.h index 8261f8f98..1bfe669ab 100644 --- a/include/common/compat.h +++ b/include/common/compat.h @@ -22,6 +22,15 @@ #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 #include