From 74f1309af5310fbfa346048f8ecfc7fe1e8a4571 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 11 Oct 2025 03:09:35 +0100 Subject: Improve gamedata codegen and fix spurious cases The old GAMESPECIFIC mechanism had worked in practice but was technically a little bit incorrect, oops. --- src/gamedata.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gamedata.h') diff --git a/src/gamedata.h b/src/gamedata.h index 7d91373..c14c83c 100644 --- a/src/gamedata.h +++ b/src/gamedata.h @@ -17,6 +17,15 @@ #ifndef INC_GAMEDATA_H #define INC_GAMEDATA_H +#include "gametype.h" + +// this defaults to zero (tentative definition), but gets defined to a value by +// GAMESPECIFIC() in feature.h. static const int variables get constant-folded +// even in -O0. so, this lets us short-circuit has_ checks inside features. +// we also check if a gamedata entry's +__attribute((unused)) +static const int _gamedata_feattags; + // STUPID HACK to avoid pollution if abi.h not already included (only because // generated gamedata stuff relies on this being defined) #ifndef NVDTOR -- cgit v1.2.3-54-g00ecf