mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-31 19:29:18 +00:00
racing:: with CAP_RACING off, no warning on unused variable racing::on
This commit is contained in:
parent
8225593756
commit
490ee83f3a
13
hyper.h
13
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user