diff --git a/0003-Changes-to-support-binary-schema-file-loading-and-parsing.patch b/0003-Changes-to-support-binary-schema-file-loading-and-parsing.patch new file mode 100644 index 0000000000000000000000000000000000000000..bbaf8d69123280e7f03c731635da9789fb72761a --- /dev/null +++ b/0003-Changes-to-support-binary-schema-file-loading-and-parsing.patch @@ -0,0 +1,25 @@ +diff --git a/src/flatc.cpp b/src/flatc.cpp +index 221b886..a3043cc 100644 +--- a/src/flatc.cpp ++++ b/src/flatc.cpp +@@ -453,16 +453,17 @@ int FlatCompiler::Compile(int argc, const char **argv) { + contents.length() != strlen(contents.c_str())) { + Error("input file appears to be binary: " + filename, true); + } +- if (is_schema) { ++ if (is_schema || is_binary_schema) { + // If we're processing multiple schemas, make sure to start each + // one from scratch. If it depends on previous schemas it must do + // so explicitly using an include. + parser.reset(new flatbuffers::Parser(opts)); + } ++ // Try to parse the file contents (binary schema/flexbuffer/textual ++ // schema) + if (is_binary_schema) { + LoadBinarySchema(*parser.get(), filename, contents); +- } +- if (opts.use_flexbuffers) { ++ } else if (opts.use_flexbuffers) { + if (opts.lang_to_generate == IDLOptions::kJson) { + parser->flex_root_ = flexbuffers::GetRoot( + reinterpret_cast(contents.c_str()), diff --git a/flatbuffers.spec b/flatbuffers.spec index 49ae4b78cc8b5d1b328b5118ca63695efaf19055..b27ec4c65985ece7c7449e042d9ae9b3e9a01828 100644 --- a/flatbuffers.spec +++ b/flatbuffers.spec @@ -5,7 +5,7 @@ %endif Name: flatbuffers Version: 2.0.0 -Release: 2 +Release: 4 Summary: Memory efficient serialization library License: Apache-2.0 URL: https://github.com/google/flatbuffers @@ -14,6 +14,8 @@ Source1: flatc.1 Source2: flatbuffers.7 Patch0: 0001-Fix-compiler-warning-Wredundant-parens.patch +Patch1: 0002-typo-fixes-in-comments.patch +Patch2: 0003-Changes-to-support-binary-schema-file-loading-and-parsing.patch BuildRequires: gcc-c++ cmake >= 2.8.9 Provides: bundled(grpc) @@ -82,4 +84,10 @@ make test - Package init * Wed Nov 11 2021 yefeng - 2.0.0-2 -- Package init \ No newline at end of file +- Fix Clang complication + +* Wed Nov 15 2021 yefeng - 2.0.0-3 +- Typo fixes in comments + +* Wed Nov 15 2021 yefeng - 2.0.0-4 +- Changes to support binary schema file \ No newline at end of file