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:
parent
18845b3ce0
commit
3ead704f1d
|
@ -68,10 +68,22 @@
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \def DECLARE_ENUM
|
* \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;
|
#define VAR_UNUSED(x) (void)x;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue