From 3ead704f1da31ea6899d54329b859ce4c74d0335 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 11 Jul 2016 21:32:20 +0200 Subject: [PATCH] Improve DECLARE_ENUM macro - DECLARE_ENUM now declares a regular enum. - DECLARE_ENUM_CLASS declares an enum class. - Macros don't include a trailing ';' so they can also be used when defining an enum. --- application/global.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/application/global.h b/application/global.h index 2a616d3..bb46d1e 100644 --- a/application/global.h +++ b/application/global.h @@ -68,10 +68,22 @@ /*! * \def DECLARE_ENUM - * \brief Forward-declares enums without preventing lupdate to parse the file correctly. + * \brief Declares an enum without preventing lupdate to parse the file correctly. */ -#define DECLARE_ENUM(name, base) enum class name : base; +#define DECLARE_ENUM(name, base) enum name : base + +/*! + * \def DECLARE_ENUM_CLASS + * \brief Declares an enum without preventing lupdate to parse the file correctly. + */ + +#define DECLARE_ENUM_CLASS(name, base) enum class name : base + +/*! + * \def VAR_UNUSED + * \brief Prevents warnings about unused variables. + */ #define VAR_UNUSED(x) (void)x;