mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
[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.
This commit is contained in:
parent
2b1dccd501
commit
3ff3dc1fb1
@ -22,6 +22,15 @@
|
|||||||
#ifndef _COMMON_COMPAT_H
|
#ifndef _COMMON_COMPAT_H
|
||||||
#define _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 */
|
/* This is needed on Linux for Netfilter includes */
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <common/config.h>
|
#include <common/config.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user