diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 9b8b1ded3..954de6caf 100644 --- a/configure.ac +++ b/configure.ac @@ -353,16 +353,17 @@ AC_COMPILE_IFELSE( [ AC_MSG_RESULT([no]) ] ) -AC_MSG_CHECKING([if compiler supports named struct initialisers]) +AC_MSG_CHECKING([if compiler supports compound literals]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <stdlib.h>]], - [[ struct foo { int bar; int baz; }; - struct foo blerg = {.bar = 1, .baz = 2}; - exit((blerg.bar == 1 && blerg.baz == 2) ? 0 : 1); + [[ struct foo { int bar; int baz; }; + void *fooc = &(struct foo){.bar = 1, .baz = 2}; + struct foo *foo2 = (struct foo *)fooc; + return (foo2->bar == 1 && foo2->baz == 2) ? 0 : 1; ]])], [ AC_MSG_RESULT([yes]) - AC_DEFINE(NAMED_STRUCT_INITIALISERS, [1], - [compiler supports named struct initializers]) ], + AC_DEFINE(COMPOUND_LITERALS, [1], + [compiler supports compound literals]) ], [ AC_MSG_RESULT([no]) ] ) |