summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-09-21 05:15:26 +0000
committerMarc Laukien <marc@zeroc.com>2001-09-21 05:15:26 +0000
commit1271a5f7e10f941c46e3c48c3ac1efca2bd6a4d3 (patch)
tree620c987e78639c00cc0a4c5813e16eec9e067a78 /cpp/src/slice2cpp/Gen.cpp
parentmore Slice error detection; Slice enumerator documentation (diff)
downloadice-1271a5f7e10f941c46e3c48c3ac1efca2bd6a4d3.tar.bz2
ice-1271a5f7e10f941c46e3c48c3ac1efca2bd6a4d3.tar.xz
ice-1271a5f7e10f941c46e3c48c3ac1efca2bd6a4d3.zip
win fixes
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp39
1 files changed, 26 insertions, 13 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 95ff7ec2e49..98e5f039e78 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1542,7 +1542,10 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
H << sp;
H << nl << exp2 << "static ::std::string __all[" << allOpNames.size() << "];";
- H << nl << exp2 << "static ::std::string __mutating[" << allMutatingOpNames.size() << "];";
+ if (!allMutatingOpNames.empty())
+ {
+ H << nl << exp2 << "static ::std::string __mutating[" << allMutatingOpNames.size() << "];";
+ }
H << nl << exp2 << "virtual ::IceInternal::DispatchStatus "
<< "__dispatch(::IceInternal::Incoming&, const ::std::string&);";
H << nl << exp2 << "virtual bool __isMutating(const ::std::string&);";
@@ -1559,19 +1562,22 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
}
}
C << eb << ';';
- C << sp;
- C << nl << "::std::string " << scoped.substr(2) << "::__mutating[] =";
- C << sb;
- q = allMutatingOpNames.begin();
- while (q != allMutatingOpNames.end())
+ if (!allMutatingOpNames.empty())
{
- C << nl << '"' << *q << '"';
- if (++q != allMutatingOpNames.end())
+ C << sp;
+ C << nl << "::std::string " << scoped.substr(2) << "::__mutating[] =";
+ C << sb;
+ q = allMutatingOpNames.begin();
+ while (q != allMutatingOpNames.end())
{
- C << ',';
+ C << nl << '"' << *q << '"';
+ if (++q != allMutatingOpNames.end())
+ {
+ C << ',';
+ }
}
+ C << eb << ';';
}
- C << eb << ';';
C << sp;
C << nl << "::IceInternal::DispatchStatus" << nl << scoped.substr(2)
<< "::__dispatch(::IceInternal::Incoming& in, const ::std::string& s)";
@@ -1603,9 +1609,16 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
C << nl << "bool" << nl << scoped.substr(2)
<< "::__isMutating(const ::std::string& s)";
C << sb;
- C << nl << "::std::string* b = __mutating;";
- C << nl << "::std::string* e = __mutating + " << allMutatingOpNames.size() << ';';
- C << nl << "return ::std::binary_search(b, e, s);";
+ if (!allMutatingOpNames.empty())
+ {
+ C << nl << "::std::string* b = __mutating;";
+ C << nl << "::std::string* e = __mutating + " << allMutatingOpNames.size() << ';';
+ C << nl << "return ::std::binary_search(b, e, s);";
+ }
+ else
+ {
+ C << nl << "return false;";
+ }
C << eb;
}
H << sp;