Enforce matching version in Java and C#.

Change-Id: I7f1f12f2f97e5227e0dabc2965ce66a6d41c229c
This commit is contained in:
Wouter van Oortmerssen
2019-05-31 11:29:09 -07:00
parent 3a88e1031b
commit c978b9ef1f
35 changed files with 55 additions and 34 deletions

View File

@@ -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;