From a044c97c30d014b7b8db7d72b03dc48829e1099a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 18 Aug 2017 20:10:54 +0300 Subject: Allow set type for strong typed enum with values. --- src/enums/net/mailopentype.h | 2 +- src/enums/simpletypes/enumdefines.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/enums/net/mailopentype.h b/src/enums/net/mailopentype.h index 5040cee18..ad62a0252 100644 --- a/src/enums/net/mailopentype.h +++ b/src/enums/net/mailopentype.h @@ -23,7 +23,7 @@ #include "enums/simpletypes/enumdefines.h" -enumStart(MailOpenType) +enumStartT(MailOpenType, int8_t) { Mail = 0, Account = 1, diff --git a/src/enums/simpletypes/enumdefines.h b/src/enums/simpletypes/enumdefines.h index 4db9bbab6..a1b5401ff 100644 --- a/src/enums/simpletypes/enumdefines.h +++ b/src/enums/simpletypes/enumdefines.h @@ -26,6 +26,7 @@ #ifdef ADVGCC #define enumStart(name) enum class name +#define enumStartT(name, type) enum class name : type #define enumEnd(name) ; \ typedef name name##T @@ -36,6 +37,11 @@ { \ enum T +#define enumStartT(name, type) \ + namespace name \ + { \ + enum T + #define enumEnd(name) \ ;\ } \ -- cgit v1.2.3-70-g09d2