mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 11:51:38 +00:00
Do not create empty enums.
Mac build issued a warning for enum{}.
Change-Id: I9cab958538ac3cec61aeae289d1da0118ecac15f
Tested: Mac build no longer issues warnings.
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
45bda6e08d
commit
fe2f8d32aa
@@ -260,6 +260,7 @@ static void GenTable(const Parser &parser, StructDef &struct_def,
|
|||||||
code += " FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table";
|
code += " FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table";
|
||||||
code += " {\n";
|
code += " {\n";
|
||||||
// Generate field id constants.
|
// Generate field id constants.
|
||||||
|
if (struct_def.fields.vec.size() > 0) {
|
||||||
code += " enum {\n";
|
code += " enum {\n";
|
||||||
for (auto it = struct_def.fields.vec.begin();
|
for (auto it = struct_def.fields.vec.begin();
|
||||||
it != struct_def.fields.vec.end();
|
it != struct_def.fields.vec.end();
|
||||||
@@ -271,6 +272,7 @@ static void GenTable(const Parser &parser, StructDef &struct_def,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
code += " };\n";
|
code += " };\n";
|
||||||
|
}
|
||||||
// Generate the accessors.
|
// Generate the accessors.
|
||||||
for (auto it = struct_def.fields.vec.begin();
|
for (auto it = struct_def.fields.vec.begin();
|
||||||
it != struct_def.fields.vec.end();
|
it != struct_def.fields.vec.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user