diff options
author | Michi Henning <michi@zeroc.com> | 2003-08-10 23:38:04 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2003-08-10 23:38:04 +0000 |
commit | 5de88b3cc716113849a8329cfd3e67317970460a (patch) | |
tree | 8caa8fa8f9df405ee2ae8dee2974b5f5c87e79c5 /cpp/src/slice2cpp/Gen.cpp | |
parent | adding support for object factories; adding value demo (diff) | |
download | ice-5de88b3cc716113849a8329cfd3e67317970460a.tar.bz2 ice-5de88b3cc716113849a8329cfd3e67317970460a.tar.xz ice-5de88b3cc716113849a8329cfd3e67317970460a.zip |
Fixed bug in code generation for ice_clone() under Windows.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index b93b6064cdf..ad7fe398cb6 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -2147,18 +2147,44 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << scoped.substr(2) << "::ice_clone() const"; C << sb; C << nl << scoped << "Ptr __p = new " << scoped << ";"; + string winUpcall; + string unixUpcall; if(!bases.empty() && !bases.front()->isInterface()) { - C << nl << fixKwd(bases.front()->scoped()) << "::__copyMembers(__p);"; + winUpcall = fixKwd(bases.front()->scoped().substr(2)) + "::__copyMembers(__p);"; + unixUpcall = fixKwd(bases.front()->scoped()) + "::__copyMembers(__p);"; } else { - C << nl << "::Ice::Object::__copyMembers(__p);"; + winUpcall = "Ice::Object::__copyMembers(__p);"; + unixUpcall = "::Ice::Object::__copyMembers(__p);"; } + string winCall; + string unixCall; if(!dataMembers.empty()) { - C << nl << scoped << "::__copyMembers(__p);"; + winCall = scoped.substr(2) + "::__copyMembers(__p);"; + unixCall = scoped + "::__copyMembers(__p);"; } + C.zeroIndent(); + C << nl << "#ifdef _WIN32"; // COMPILERBUG + C.restoreIndent(); + C << nl << winUpcall; + if(!winCall.empty()) + { + C << nl << winCall; + } + C.zeroIndent(); + C << nl << "#else"; + C.restoreIndent(); + C << nl << unixUpcall; + if(!unixCall.empty()) + { + C << nl << unixCall; + } + C.zeroIndent(); + C << nl << "#endif"; + C.restoreIndent(); C << nl << "return __p;"; C << eb; } |