Fixed more Windows build errors.

Change-Id: I556e1c103e8501dc144b16c8698463253de6f4fb
This commit is contained in:
Wouter van Oortmerssen
2016-12-21 17:45:27 -08:00
parent 13194ececa
commit b9efbf6a3d
9 changed files with 23 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ template<> struct EquipmentTraits<Weapon> {
struct EquipmentUnion {
Equipment type;
flatbuffers::NativeTable *table = nullptr;
flatbuffers::NativeTable *table;
EquipmentUnion() : type(Equipment_NONE), table(nullptr) {}
EquipmentUnion(const EquipmentUnion &);
EquipmentUnion &operator=(const EquipmentUnion &);

View File

@@ -526,7 +526,7 @@ class CppGenerator : public BaseGenerator {
// Generate a union type
code += "struct " + enum_def.name + "Union {\n";
code += " " + enum_def.name + " type;\n\n";
code += " flatbuffers::NativeTable *table = nullptr;\n";
code += " flatbuffers::NativeTable *table;\n";
code += " " + enum_def.name + "Union() : type(";
code += GetEnumValUse(enum_def, *enum_def.vals.Lookup("NONE"), parser_.opts);
code += "), table(nullptr) {}\n";

Binary file not shown.

View File

@@ -78,7 +78,7 @@ template<> struct AnyTraits<MyGame::Example2::Monster> {
struct AnyUnion {
Any type;
flatbuffers::NativeTable *table = nullptr;
flatbuffers::NativeTable *table;
AnyUnion() : type(Any_NONE), table(nullptr) {}
AnyUnion(const AnyUnion &);
AnyUnion &operator=(const AnyUnion &);

View File

@@ -15,6 +15,10 @@ func (rcv *StructInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *StructInNestedNS) Table() flatbuffers.Table {
return rcv._tab.Table
}
func (rcv *StructInNestedNS) A() int32 {
return rcv._tab.GetInt32(rcv._tab.Pos + flatbuffers.UOffsetT(0))
}

View File

@@ -22,6 +22,10 @@ func (rcv *TableInNestedNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *TableInNestedNS) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TableInNestedNS) Foo() int32 {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {

View File

@@ -22,6 +22,10 @@ func (rcv *SecondTableInA) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *SecondTableInA) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *SecondTableInA) ReferToC(obj *TableInC) *TableInC {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {

View File

@@ -22,6 +22,10 @@ func (rcv *TableInFirstNS) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *TableInFirstNS) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TableInFirstNS) FooTable(obj *TableInNestedNS) *TableInNestedNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {

View File

@@ -22,6 +22,10 @@ func (rcv *TableInC) Init(buf []byte, i flatbuffers.UOffsetT) {
rcv._tab.Pos = i
}
func (rcv *TableInC) Table() flatbuffers.Table {
return rcv._tab
}
func (rcv *TableInC) ReferToA1(obj *TableInFirstNS) *TableInFirstNS {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {