diff options
author | Jose <jose@zeroc.com> | 2016-01-05 13:21:46 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2016-01-05 13:21:46 +0100 |
commit | a853ab8ed86cb6671758629da2f9a0b4f0abf0ae (patch) | |
tree | 2b2f6a4d74f1f38c5f268074104695bed0b7053f /cpp/src/slice2cpp/Gen.cpp | |
parent | Merge remote-tracking branch 'origin/3.6' (diff) | |
download | ice-a853ab8ed86cb6671758629da2f9a0b4f0abf0ae.tar.bz2 ice-a853ab8ed86cb6671758629da2f9a0b4f0abf0ae.tar.xz ice-a853ab8ed86cb6671758629da2f9a0b4f0abf0ae.zip |
C++98 object factory static initialization simplification
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index e57d31c7686..77ff61ece97 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -3126,13 +3126,6 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) inProtected = true; } H << sp << nl << "virtual ~" << fixKwd(p->name()) << "() {}"; - - if(!_doneStaticSymbol) - { - H.dec(); - H << sp << nl << "friend class " << p->name() << "__staticInit;"; - H.inc(); - } } if(!p->isLocal() && preserved && !basePreserved) @@ -3156,33 +3149,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) // But we do this only once per source file, because a single instance is sufficient to initialize // all of the globals in a compilation unit. // - 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(); - H << nl << "public:"; - H.inc(); - H << sp << nl << scoped << " _init;"; - H << eb << ';'; - _doneStaticSymbol = true; - 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(); + H << nl << "static ::Ice::ValueFactoryPtr _" << p->name() << "_init = " << p->scoped() << "::ice_factory();"; } if(p->isLocal()) |