Preprocess out glmprintf in normal builds

Using sizeof(con_printf A) was a trick to avoid code generation, but it
interacts badly with gcc-6 and the other macros that con_printf
produces.  On >=gcc-6, `DXX_ALWAYS_ERROR_FUNCTION` is a complicated hack
to work around undesirable changes in `__builtin_constant_p`.  That hack
includes introducing a dummy type.  gcc-6 rejects declaring a type
inside a statement expression inside a sizeof.  gcc-7 permits this, so
it went unnoticed.

This particular usage was to prevent future regressions in calls that
had been broken for years without anyone noticing.  As such, reverting
to not checking those calls is unlikely to matter.

Reported-by: Ambaire <https://github.com/dxx-rebirth/dxx-rebirth/issues/393#issuecomment-401565872>
Fixes: 9b17450914 ("Fix up long broken glmprintf support")
This commit is contained in:
Kp 2018-06-30 21:53:55 +00:00
parent 90dfedb5cb
commit da268c6d21

View file

@ -72,7 +72,7 @@ using std::max;
#if 0
#define glmprintf(A) con_printf A
#else
#define glmprintf(A) (void)(sizeof(con_printf A, 0))
#define glmprintf(A)
#endif
#ifndef M_PI