diff options
Diffstat (limited to 'cpp/src/Slice/CsUtil.cpp')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index ae9ed24bc11..c5ef9a41d29 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -26,6 +26,16 @@ using namespace std; using namespace Slice; using namespace IceUtil; +// +// TODO: Temporary work-around for Mono compiler bug: "global::" does not work for generic classes. +// + +static string +global() +{ + return "\n#if !__MonoCS__ \nglobal::\n#endif\n"; +} + static string lookupKwd(const string& name, int baseTypes, bool mangleCasts = false) { @@ -198,7 +208,7 @@ Slice::CsGenerator::typeToString(const TypePtr& type) } else { - return "global::" + type + "<" + typeToString(seq->type()) + ">"; + return global() + type + "<" + typeToString(seq->type()) + ">"; } } @@ -763,7 +773,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - out << "global::" << genericType << "<Ice.Object>();"; + out << global() << genericType << "<Ice.Object>();"; } else if(isGeneric) { @@ -878,7 +888,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else if(isCustom) { out << sb; - out << nl << param << " = new " << "global::" << genericType << "<" + out << nl << param << " = new " << global() << genericType << "<" << typeToString(type) << ">();"; out << nl << "int szx__ = " << stream << ".readSize();"; out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; @@ -959,7 +969,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - out << "global::" << genericType << "<" << typeS << ">()"; + out << global() << genericType << "<" << typeS << ">()"; } else if(isGeneric) { @@ -1097,7 +1107,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - out << "global::" << genericType << "<" << typeS << ">();"; + out << global() << genericType << "<" << typeS << ">();"; } else if(isGeneric) { @@ -1234,7 +1244,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - out << "global::" << genericType << "<" << typeS << ">();"; + out << global() << genericType << "<" << typeS << ">();"; } else if(isGeneric) { @@ -1349,7 +1359,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - out << "global::" << genericType << "<" << typeS << ">();"; + out << global() << genericType << "<" << typeS << ">();"; } else if(isGeneric) { |