Added min/max values for enums/unions.

Bug: 21642898
Change-Id: Ifaf0b3c4274fe30ef29507ba1c1216d700efe85b
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2016-01-08 14:31:26 -08:00
parent f8c1980fdf
commit e848137ded
5 changed files with 29 additions and 12 deletions

View File

@@ -23,7 +23,9 @@ struct Monster;
enum Color {
Color_Red = 1,
Color_Green = 2,
Color_Blue = 8
Color_Blue = 8,
Color_MIN = Color_Red,
Color_MAX = Color_Blue
};
inline const char **EnumNamesColor() {
@@ -36,7 +38,9 @@ inline const char *EnumNameColor(Color e) { return EnumNamesColor()[static_cast<
enum Any {
Any_NONE = 0,
Any_Monster = 1,
Any_TestSimpleTableWithEnum = 2
Any_TestSimpleTableWithEnum = 2,
Any_MIN = Any_NONE,
Any_MAX = Any_TestSimpleTableWithEnum
};
inline const char **EnumNamesAny() {