diff --git a/src/engine/command.cc b/src/engine/command.cc index ff0fab0..52478e1 100644 --- a/src/engine/command.cc +++ b/src/engine/command.cc @@ -211,7 +211,7 @@ static bool initidents() } return true; } -UNUSED static bool forceinitidents = initidents(); +[[maybe_unused]] static bool forceinitidents = initidents(); static const char *sourcefile = nullptr, *sourcestr = nullptr; diff --git a/src/engine/rendermodel.cc b/src/engine/rendermodel.cc index 4d324d2..5a50ef5 100644 --- a/src/engine/rendermodel.cc +++ b/src/engine/rendermodel.cc @@ -47,7 +47,7 @@ static model *__loadmodel__##modelclass(const char *filename) \ { \ return new modelclass(filename); \ } \ -UNUSED static int __dummy__##modelclass = addmodeltype((modeltype), __loadmodel__##modelclass); +[[maybe_unused]] static int __dummy__##modelclass = addmodeltype((modeltype), __loadmodel__##modelclass); static void loadskin(const char *dir, const char *altdir, Texture *&skin, Texture *&masks); diff --git a/src/sauerlib/tools.hh b/src/sauerlib/tools.hh index db745f7..3245edc 100644 --- a/src/sauerlib/tools.hh +++ b/src/sauerlib/tools.hh @@ -20,12 +20,6 @@ #define RESTRICT #endif -#ifdef __GNUC__ -#define UNUSED __attribute__((unused)) -#else -#define UNUSED -#endif - #ifdef swap #undef swap #endif diff --git a/src/shared/command.hh b/src/shared/command.hh index 06fc002..6db3613 100644 --- a/src/shared/command.hh +++ b/src/shared/command.hh @@ -315,8 +315,8 @@ inline void ident::getcval(tagval &v) const } // nasty macros for registering script functions, abuses globals to avoid excessive infrastructure -#define KEYWORD(name, type) UNUSED static bool __dummy_##type = addcommand(#name, (identfun)nullptr, nullptr, type) -#define COMMANDKN(name, type, fun, nargs) UNUSED static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs, type) +#define KEYWORD(name, type) [[maybe_unused]] static bool __dummy_##type = addcommand(#name, (identfun)nullptr, nullptr, type) +#define COMMANDKN(name, type, fun, nargs) [[maybe_unused]] static bool __dummy_##fun = addcommand(#name, (identfun)fun, nargs, type) #define COMMANDK(name, type, nargs) COMMANDKN(name, type, name, nargs) #define COMMANDN(name, fun, nargs) COMMANDKN(name, ID_COMMAND, fun, nargs) #define COMMAND(name, nargs) COMMANDN(name, name, nargs)