mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-14 00:25:26 +00:00
Enforce matching version in Java and C#.
Change-Id: I7f1f12f2f97e5227e0dabc2965ce66a6d41c229c
This commit is contained in:
@@ -848,6 +848,11 @@ class GeneralGenerator : public BaseGenerator {
|
||||
// create method that allows object reuse
|
||||
code +=
|
||||
method_signature + "(ByteBuffer _bb, " + struct_def.name + " obj) { ";
|
||||
// Force compile time error if not using the same version runtime.
|
||||
if (lang_.language == IDLOptions::kCSharp)
|
||||
code += "FlatBufferConstants.FLATBUFFERS_1_11_1(); ";
|
||||
else
|
||||
code += "Constants.FLATBUFFERS_1_11_1(); ";
|
||||
code += lang_.set_bb_byteorder;
|
||||
code += "return (obj.__assign(_bb." + FunctionStart('G') + "etInt(_bb.";
|
||||
code += lang_.get_bb_position;
|
||||
|
||||
Reference in New Issue
Block a user