diff options
-rw-r--r-- | source/include/actypes.h | 4 | ||||
-rw-r--r-- | source/include/platform/acgcc.h | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/include/actypes.h b/source/include/actypes.h index 52d2d6dcf..c0f0a87f4 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -1574,4 +1574,8 @@ typedef enum #define ACPI_FALLTHROUGH do {} while(0) #endif +#ifndef ACPI_FLEX_ARRAY +#define ACPI_FLEX_ARRAY(TYPE, NAME) TYPE NAME[0] +#endif + #endif /* __ACTYPES_H__ */ diff --git a/source/include/platform/acgcc.h b/source/include/platform/acgcc.h index 81e29f90d..55a66c6da 100644 --- a/source/include/platform/acgcc.h +++ b/source/include/platform/acgcc.h @@ -211,4 +211,15 @@ typedef __builtin_va_list va_list; #define ACPI_FALLTHROUGH __attribute__((__fallthrough__)) #endif +/* + * Flexible array members are not allowed to be part of a union under + * C99, but this is not for any technical reason. Work around the + * limitation. + */ +#define ACPI_FLEX_ARRAY(TYPE, NAME) \ + struct { \ + struct { } __Empty_ ## NAME; \ + TYPE NAME[]; \ + } + #endif /* __ACGCC_H__ */ |