diff options
author | Jose <jose@zeroc.com> | 2015-12-23 23:05:33 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2015-12-28 15:09:17 +0100 |
commit | 4061d9dd4fdfd5facddd07c39a00fc7766d4ce8a (patch) | |
tree | ca9d0053cc0f7f2b7c339f68ed46f86687992d2d /cpp/src/slice2cpp/Gen.cpp | |
parent | Visual Studio 2015 compiler fix (diff) | |
download | ice-4061d9dd4fdfd5facddd07c39a00fc7766d4ce8a.tar.bz2 ice-4061d9dd4fdfd5facddd07c39a00fc7766d4ce8a.tar.xz ice-4061d9dd4fdfd5facddd07c39a00fc7766d4ce8a.zip |
Fix binary compatibility issue with previous fix
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 61 |
1 files changed, 13 insertions, 48 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 037c788a275..dff1f3c31aa 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3292,65 +3292,18 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) if(!p->isAbstract()) { - bool restoreInProtected = false; // // We add a protected destructor to force heap instantiation of the class. // - if(inProtected) - { - H.zeroIndent(); - H << nl << "#if defined(_MSC_VER) && (_MSC_VER >= 1900)"; - H.restoreIndent(); - - H << nl << "//"; - H << nl << "// COMPILERFIX: Visual Studio 2015 update 1 fails to access"; - H << nl << "// the proected destructor from a friend class."; - H << nl << "//"; - H << nl << "public:"; - - H.zeroIndent(); - H << nl << "#endif"; - restoreInProtected = true; - H.restoreIndent(); - } - else + if(!inProtected) { H.dec(); - - H.zeroIndent(); - H << nl << "#if !defined(_MSC_VER) || (_MSC_VER < 1900)"; - H.restoreIndent(); - H << nl << "//"; - H << nl << "// COMPILERFIX: Visual Studio 2015 update 1 fails to access"; - H << nl << "// the proected destructor from a friend class."; - H << nl << "//"; H << nl << "protected:"; - - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); - H.inc(); inProtected = true; } H << sp << nl << "virtual ~" << fixKwd(p->name()) << "() {}"; - if(restoreInProtected) - { - H.zeroIndent(); - H << nl << "#if defined(_MSC_VER) && (_MSC_VER >= 1900)"; - H.restoreIndent(); - H << nl << "//"; - H << nl << "// COMPILERFIX: Visual Studio 2015 update 1 fails to access"; - H << nl << "// the proected destructor from a friend class."; - H << nl << "//"; - H << nl << "protected:"; - - H.zeroIndent(); - H << nl << "#endif"; - H.restoreIndent(); - } - if(!_doneStaticSymbol) { H.dec(); @@ -3383,6 +3336,14 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) // For a Slice class Foo, we instantiate a dummy class Foo__staticInit instead of using a static // Foo instance directly because Foo has a protected destructor. // + H.zeroIndent(); + H << nl << "#if !defined(_MSC_VER) || (_MSC_VER < 1900)"; + H.restoreIndent(); + H << nl << "//"; + H << nl << "// COMPILERFIX: Visual Studio 2015 update 1 fails to access"; + H << nl << "// the proected destructor from a friend class."; + H << nl << "//"; + H << sp << nl << "class " << p->name() << "__staticInit"; H << sb; H.dec(); @@ -3392,6 +3353,10 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) H << eb << ';'; _doneStaticSymbol = true; H << sp << nl << "static " << p->name() << "__staticInit _" << p->name() << "_init;"; + + H.zeroIndent(); + H << nl << "#endif"; + H.restoreIndent(); } if(p->isLocal()) |