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,8 +777,10 @@ std::string GenerateCPP(const Parser &parser,
for (auto it = parser.structs_.vec.begin();
it != parser.structs_.vec.end(); ++it) {
auto &struct_def = **it;
CheckNameSpace(struct_def, &code);
code += "struct " + struct_def.name + ";\n\n";
if (!struct_def.generated) {
CheckNameSpace(struct_def, &code);
code += "struct " + struct_def.name + ";\n\n";
}
}
// Generate code for all the enum declarations.

View File

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