Fixed STLPort build

Change-Id: I2b9508f547667695475be64fa56f64f129603fd4
This commit is contained in:
Wouter van Oortmerssen 2018-11-05 16:33:06 -08:00
parent 980a6d66d3
commit f445c1eb4a
2 changed files with 4 additions and 3 deletions

View File

@ -2363,8 +2363,9 @@ class CppGenerator : public BaseGenerator {
// the underlying storage type (eg. uint8_t). // the underlying storage type (eg. uint8_t).
const auto basetype = GenTypeBasic( const auto basetype = GenTypeBasic(
field.value.type.enum_def->underlying_type, false); field.value.type.enum_def->underlying_type, false);
code += "_fbb.CreateVectorScalarCast<" + basetype + ">(" + value + code += "_fbb.CreateVectorScalarCast<" + basetype +
".data(), " + value + ".size())"; ">(flatbuffers::data(" + value + "), " + value +
".size())";
} else if (field.attributes.Lookup("cpp_type")) { } else if (field.attributes.Lookup("cpp_type")) {
auto type = GenTypeBasic(vector_type, false); auto type = GenTypeBasic(vector_type, false);
code += "_fbb.CreateVector<" + type + ">(" + value + ".size(), "; code += "_fbb.CreateVector<" + type + ">(" + value + ".size(), ";

View File

@ -2504,7 +2504,7 @@ inline flatbuffers::Offset<Monster> CreateMonster(flatbuffers::FlatBufferBuilder
auto _any_unique = _o->any_unique.Pack(_fbb); auto _any_unique = _o->any_unique.Pack(_fbb);
auto _any_ambiguous_type = _o->any_ambiguous.type; auto _any_ambiguous_type = _o->any_ambiguous.type;
auto _any_ambiguous = _o->any_ambiguous.Pack(_fbb); auto _any_ambiguous = _o->any_ambiguous.Pack(_fbb);
auto _vector_of_enums = _o->vector_of_enums.size() ? _fbb.CreateVectorScalarCast<int8_t>(_o->vector_of_enums.data(), _o->vector_of_enums.size()) : 0; auto _vector_of_enums = _o->vector_of_enums.size() ? _fbb.CreateVectorScalarCast<int8_t>(flatbuffers::data(_o->vector_of_enums), _o->vector_of_enums.size()) : 0;
return MyGame::Example::CreateMonster( return MyGame::Example::CreateMonster(
_fbb, _fbb,
_pos, _pos,