Fixed pre-declarations of included types in generated code.

This was harmless, but unnecessary.

Change-Id: I1365a725e254d4ebbda081110a50277cb5118323
Tested: on Linux.
parent 8128df76
......@@ -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.
......
......@@ -5,14 +5,6 @@
#include "flatbuffers/flatbuffers.h"
namespace MyGame {
namespace OtherNameSpace {
struct Unused;
} // namespace OtherNameSpace
} // namespace MyGame
namespace MyGame {
namespace Example {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment