summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2011-05-06 09:23:05 -0700
committerMark Spruiell <mes@zeroc.com>2011-05-06 09:23:05 -0700
commitcacc6ce6ad910f0b9cf313961de13dc874363977 (patch)
tree7d74d0eb61ecb18ee2c34a3cc672adfe7389ca2d /cpp/src/slice2cpp/Gen.cpp
parentfixing URL in RELEASE_NOTES (diff)
downloadice-cacc6ce6ad910f0b9cf313961de13dc874363977.tar.bz2
ice-cacc6ce6ad910f0b9cf313961de13dc874363977.tar.xz
ice-cacc6ce6ad910f0b9cf313961de13dc874363977.zip
bug 4857 - incorrect linkage for types with default values
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index dda60d533d5..9150549bcd5 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1048,7 +1048,8 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p)
string name = fixKwd(p->name());
- if(findMetaData(p->getMetaData()) == "class")
+ bool classMetaData = findMetaData(p->getMetaData()) == "class";
+ if(classMetaData)
{
H << sp << nl << "class " << _dllExport << name << " : public IceUtil::Shared";
H << sb;
@@ -1078,7 +1079,7 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p)
H << sb;
if(p->hasDefaultValues())
{
- H << nl << name << "();";
+ H << nl << _dllExport << name << "();";
C << sp << nl << fixKwd(p->scoped()).substr(2) << "::" << fixKwd(p->name()) << "() :";
C.inc();
@@ -1106,6 +1107,10 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p)
}
H << nl;
+ if(!classMetaData)
+ {
+ H << _dllExport;
+ }
if(paramDecls.size() == 1)
{
H << "explicit ";