summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2015-12-28 14:15:32 +0100
committerJose <jose@zeroc.com>2015-12-28 14:15:32 +0100
commitba39ff673427fb8ba7bda2dba0381df626799ca0 (patch)
tree693559d12203cbdc55e34101505015bf625a4762 /cpp/src/slice2cpp
parentFix website links (diff)
downloadice-ba39ff673427fb8ba7bda2dba0381df626799ca0.tar.bz2
ice-ba39ff673427fb8ba7bda2dba0381df626799ca0.tar.xz
ice-ba39ff673427fb8ba7bda2dba0381df626799ca0.zip
Object factory registration fix for VS 2015
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index dff1f3c31aa..cffcff2bafe 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -3326,7 +3326,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
H << eb << ';';
- if(!p->isAbstract() && !_doneStaticSymbol)
+ if(!p->isAbstract() && !p->isLocal() && !_doneStaticSymbol)
{
//
// We need an instance here to trigger initialization if the implementation is in a shared library.
@@ -3355,6 +3355,12 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
H << sp << nl << "static " << p->name() << "__staticInit _" << p->name() << "_init;";
H.zeroIndent();
+ H << nl << "#else";
+ H.restoreIndent();
+
+ H << nl << "static auto _" << p->name() << "_init = " << p->scoped() << "::ice_factory;";
+
+ H.zeroIndent();
H << nl << "#endif";
H.restoreIndent();
}