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.
This commit is contained in:
Martchus 2016-07-11 21:32:20 +02:00
parent 18845b3ce0
commit 3ead704f1d
1 changed files with 14 additions and 2 deletions

View File

@ -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;