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.

704:   #define W_PROFILING_DEBIG(...)   #endif /* PROFILING_DEBUG */    + #ifdef HAVE_C99_STRUCT_LITERAL_EXPR + /* This macro is used for eg type-safe struct initializers. */ + #define CAST_STRUCT_LITERAL(TYPE, LITERAL) ((TYPE)LITERAL) + #else + /* Prior to C99 the literal was a special form only valid in +  * initializers (ie not in general expressions). +  */ + #define CAST_STRUCT_LITERAL(TYPE, LITERAL) LITERAL   #endif -  +  + #endif