diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/alloc_fini.cxx | 29 | ||||
-rw-r--r-- | sal/rtl/bootstrap.cxx | 10 |
2 files changed, 24 insertions, 15 deletions
diff --git a/sal/rtl/alloc_fini.cxx b/sal/rtl/alloc_fini.cxx index 3745e900c86d..ba798452dedf 100644 --- a/sal/rtl/alloc_fini.cxx +++ b/sal/rtl/alloc_fini.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <rtl/instance.hxx> - #include <rtllifecycle.h> namespace @@ -34,13 +32,16 @@ namespace rtl_cache_fini(); } }; - class theCacheSingleton - : public rtl::Static<rtlCacheSingleton, theCacheSingleton>{}; + rtlCacheSingleton& theCacheSingleton() + { + static rtlCacheSingleton SINGLETON; + return SINGLETON; + } } void ensureCacheSingleton() { - theCacheSingleton::get(); + theCacheSingleton(); } namespace @@ -56,13 +57,16 @@ namespace rtl_arena_fini(); } }; - class theArenaSingleton - : public rtl::Static<rtlArenaSingleton, theArenaSingleton>{}; + rtlArenaSingleton& theArenaSingleton() + { + static rtlArenaSingleton SINGLETON; + return SINGLETON; + } } void ensureArenaSingleton() { - theArenaSingleton::get(); + theArenaSingleton(); } namespace @@ -78,13 +82,16 @@ namespace rtl_locale_fini(); } }; - class theLocaleSingleton - : public rtl::Static<rtlLocaleSingleton, theLocaleSingleton>{}; + rtlLocaleSingleton& theLocaleSingleton() + { + static rtlLocaleSingleton SINGLETON; + return SINGLETON; + } } void ensureLocaleSingleton() { - theLocaleSingleton::get(); + theLocaleSingleton(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 9feadf874e54..e651a8436363 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -33,7 +33,6 @@ #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> #include <rtl/byteseq.hxx> -#include <rtl/instance.hxx> #include <rtl/malformeduriexception.hxx> #include <rtl/uri.hxx> #include <sal/log.hxx> @@ -407,8 +406,11 @@ struct FundamentalIniData FundamentalIniData& operator=(const FundamentalIniData&) = delete; }; -struct FundamentalIni: public rtl::Static< FundamentalIniData, FundamentalIni > -{}; +FundamentalIniData& FundamentalIni() +{ + static FundamentalIniData SINGLETON; + return SINGLETON; +} } @@ -511,7 +513,7 @@ bool Bootstrap_Impl::getValue( if (mode == LOOKUP_MODE_NORMAL) { - FundamentalIniData const & d = FundamentalIni::get(); + FundamentalIniData const & d = FundamentalIni(); Bootstrap_Impl const * b = static_cast<Bootstrap_Impl const *>(d.ini); if (b != nullptr && b != this && b->getDirectValue(key, value, mode, requestStack)) return true; |