From 490ee83f3a0e8bf711ec7de2234346f6fa83549a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 6 Dec 2018 15:35:01 +0100 Subject: [PATCH] racing:: with CAP_RACING off, no warning on unused variable racing::on --- hyper.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hyper.h b/hyper.h index d356fd64..f4ceca99 100644 --- a/hyper.h +++ b/hyper.h @@ -4697,7 +4697,18 @@ bool subscreen_split(reaction_t for_each_subscreen); #else -namespace racing { static bool on = false; } +// static bool on = false: emits a warning +// static const bool on = false: no warning, but does not allow assignment + +struct always_false { + operator bool() const { return false; }; + void operator = (bool b) const {}; + }; + +namespace racing { + static const always_false on; + } + inline bool subscreen_split(reaction_t for_each_subscreen) { return false; } #endif