Skip to content

Commit 127238c

Browse files
dbaileychessLuckyRu
authored andcommitted
Change monster_extra generation to use flatbuffers::unique_ptr (google#5612)
1 parent a6fca3d commit 127238c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/generate_code.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if "%1"=="-b" set buildtype=%2
2626

2727
IF NOT "%MONSTER_EXTRA%"=="skip" (
2828
@echo Generate MosterExtra
29-
..\%buildtype%\flatc.exe --cpp --java --csharp --python --gen-mutable --reflect-names --gen-object-api --gen-compare --no-includes monster_extra.fbs monsterdata_extra.json || goto FAIL
29+
..\%buildtype%\flatc.exe --cpp --java --csharp --python --gen-mutable --reflect-names --gen-object-api --gen-compare --no-includes --cpp-ptr-type flatbuffers::unique_ptr monster_extra.fbs monsterdata_extra.json || goto FAIL
3030
) else (
3131
@echo monster_extra.fbs skipped (the strtod function from MSVC2013 or older doesn't support NaN/Inf arguments)
3232
)

tests/generate_code.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set -e
2121
../flatc -b --schema --bfbs-comments --bfbs-builtins -I include_test monster_test.fbs
2222
../flatc -b --schema --bfbs-comments --bfbs-builtins -I include_test arrays_test.fbs
2323
../flatc --jsonschema --schema -I include_test monster_test.fbs
24-
../flatc --cpp --java --kotlin --csharp --python --gen-mutable --reflect-names --gen-object-api --gen-compare --no-includes monster_extra.fbs monsterdata_extra.json
24+
../flatc --cpp --java --kotlin --csharp --python --gen-mutable --reflect-names --gen-object-api --gen-compare --no-includes --cpp-ptr-type flatbuffers::unique_ptr monster_extra.fbs monsterdata_extra.json
2525
../flatc --cpp --java --csharp --python --gen-mutable --reflect-names --gen-object-api --gen-compare --no-includes --scoped-enums --jsonschema --cpp-ptr-type flatbuffers::unique_ptr arrays_test.fbs
2626
cd ../samples
2727
../flatc --cpp --lobster --gen-mutable --reflect-names --gen-object-api --gen-compare --cpp-ptr-type flatbuffers::unique_ptr monster.fbs

tests/monster_extra_generated.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,16 @@ inline void FinishSizePrefixedMonsterExtraBuffer(
389389
fbb.FinishSizePrefixed(root, MonsterExtraIdentifier());
390390
}
391391

392-
inline std::unique_ptr<MyGame::MonsterExtraT> UnPackMonsterExtra(
392+
inline flatbuffers::unique_ptr<MyGame::MonsterExtraT> UnPackMonsterExtra(
393393
const void *buf,
394394
const flatbuffers::resolver_function_t *res = nullptr) {
395-
return std::unique_ptr<MyGame::MonsterExtraT>(GetMonsterExtra(buf)->UnPack(res));
395+
return flatbuffers::unique_ptr<MyGame::MonsterExtraT>(GetMonsterExtra(buf)->UnPack(res));
396396
}
397397

398-
inline std::unique_ptr<MyGame::MonsterExtraT> UnPackSizePrefixedMonsterExtra(
398+
inline flatbuffers::unique_ptr<MyGame::MonsterExtraT> UnPackSizePrefixedMonsterExtra(
399399
const void *buf,
400400
const flatbuffers::resolver_function_t *res = nullptr) {
401-
return std::unique_ptr<MyGame::MonsterExtraT>(GetSizePrefixedMonsterExtra(buf)->UnPack(res));
401+
return flatbuffers::unique_ptr<MyGame::MonsterExtraT>(GetSizePrefixedMonsterExtra(buf)->UnPack(res));
402402
}
403403

404404
} // namespace MyGame

0 commit comments

Comments
 (0)