diff options
Diffstat (limited to 'cpp/src/slice2cs/Gen.cpp')
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index df275353f44..429ce2c04c8 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -196,12 +196,32 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sp << nl << "public override bool ice_isA(string s)"; _out << sb; + _out.zeroIndent(); + _out << nl << "#if __MonoCS__ // Bug in Mono 1.0 DefaultInvariant"; + _out.restoreIndent(); + _out << nl << "return _System.Array.BinarySearch(__ids, s) >= 0;"; + _out.zeroIndent(); + _out << nl << "#else"; + _out.restoreIndent(); _out << nl << "return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; + _out.zeroIndent(); + _out << nl << "#endif"; + _out.restoreIndent(); _out << eb; _out << sp << nl << "public override bool ice_isA(string s, Ice.Current __current)"; _out << sb; + _out.zeroIndent(); + _out << nl << "#if __MonoCS__ // Bug in Mono 1.0 DefaultInvariant"; + _out.restoreIndent(); + _out << nl << "return _System.Array.BinarySearch(__ids, s) >= 0;"; + _out.zeroIndent(); + _out << nl << "#else"; + _out.restoreIndent(); _out << nl << "return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; + _out.zeroIndent(); + _out << nl << "#endif"; + _out.restoreIndent(); _out << eb; _out << sp << nl << "public override string[] ice_ids()"; @@ -528,8 +548,18 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sp << nl << "public override IceInternal.DispatchStatus " << "__dispatch(IceInternal.Incoming __in, Ice.Current __current)"; _out << sb; + _out.zeroIndent(); + _out << nl << "#if __MonoCS__ // Bug in Mono 1.0 DefaultInvariant"; + _out.restoreIndent(); + _out << nl << "int pos = _System.Array.BinarySearch(__all, __current.operation);"; + _out.zeroIndent(); + _out << nl << "#else"; + _out.restoreIndent(); _out << nl << "int pos = _System.Array.BinarySearch(__all, __current.operation, " << "_System.Collections.Comparer.DefaultInvariant);"; + _out.zeroIndent(); + _out << nl << "#endif"; + _out.restoreIndent(); _out << nl << "if(pos < 0)"; _out << sb; _out << nl << "return IceInternal.DispatchStatus.DispatchOperationNotExist;"; |