Branch: Tag:

2017-04-11

2017-04-11 09:04:55 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Configure: Probe support for C99-style struct literal expressions.

In C99 the expression syntax was extended to allow struct literals
in expressions, provided that they are preceeded by a suitable cast.

Adds macro CAST_STRUCT_LITERAL(), and updates buffer.h to use it.

Potential fix for build failures on NT.

6898:      #############################################################################    + AC_MSG_CHECKING(for C99-style struct literal expressions) + AC_CACHE_VAL(pike_cv_c99_struct_literal_expr, [ +  AC_TRY_COMPILE([ +  struct foo { +  int a; +  float b; +  }; +  ], [ +  struct foo f = ((struct foo){ 1, 0.5 }); +  ], [ pike_cv_c99_struct_literal_expr=yes +  ], [ pike_cv_c99_struct_literal_expr=no ]) + ]) + if test "x$pike_cv_c99_struct_literal_expr" = "xyes"; then +  AC_MSG_RESULT(yes) +  AC_DEFINE(HAVE_C99_STRUCT_LITERAL_EXPR, [], +  [C99-style struct literal expressions supported.]) + else +  AC_MSG_RESULT(no) + fi +  + ############################################################################# +    AC_MSG_CHECKING(if port.c works in CONFIGURE_TEST mode)   AC_CACHE_VAL(pike_cv_configure_test_port_c, [    AC_TRY_RUN([