Fixed pre-declarations of included types in generated code.

This was harmless, but unnecessary.

Change-Id: I1365a725e254d4ebbda081110a50277cb5118323
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen 2016-04-11 11:05:42 -07:00
parent 8128df7655
commit e597ad8f0f
2 changed files with 4 additions and 10 deletions

View File

@ -777,9 +777,11 @@ std::string GenerateCPP(const Parser &parser,
for (auto it = parser.structs_.vec.begin(); for (auto it = parser.structs_.vec.begin();
it != parser.structs_.vec.end(); ++it) { it != parser.structs_.vec.end(); ++it) {
auto &struct_def = **it; auto &struct_def = **it;
if (!struct_def.generated) {
CheckNameSpace(struct_def, &code); CheckNameSpace(struct_def, &code);
code += "struct " + struct_def.name + ";\n\n"; code += "struct " + struct_def.name + ";\n\n";
} }
}
// Generate code for all the enum declarations. // Generate code for all the enum declarations.
for (auto it = parser.enums_.vec.begin(); for (auto it = parser.enums_.vec.begin();

View File

@ -5,14 +5,6 @@
#include "flatbuffers/flatbuffers.h" #include "flatbuffers/flatbuffers.h"
namespace MyGame {
namespace OtherNameSpace {
struct Unused;
} // namespace OtherNameSpace
} // namespace MyGame
namespace MyGame { namespace MyGame {
namespace Example { namespace Example {