diff --git a/src/include/c.h b/src/include/c.h index c0be07a4566..17afaef9a6a 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -262,6 +262,16 @@ */ #endif +/* + * alignas is buggy in g++ < 9, but the more or less equivalent attribute + * works. + * + * + */ +#if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 9 +#define alignas(a) __attribute__((aligned(a))) +#endif + /* * Use "pg_attribute_always_inline" in place of "inline" for functions that * we wish to force inlining of, even when the compiler's heuristics would