From 92b136d554c690d636e3872ee67e16d4e1144d7b Mon Sep 17 00:00:00 2001 From: Matthias Kortstiege Date: Wed, 28 Oct 2015 09:41:37 +0100 Subject: [PATCH] [globals] remove macro XBMC_GLOBAL --- xbmc/guilib/GraphicContext.h | 4 ++-- xbmc/settings/AdvancedSettings.h | 3 ++- xbmc/utils/CharsetConverter.h | 4 ++-- xbmc/utils/GlobalsHandling.h | 10 ---------- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h index bafd60a0a5339..c04386e1f0bdf 100644 --- a/xbmc/guilib/GraphicContext.h +++ b/xbmc/guilib/GraphicContext.h @@ -296,6 +296,6 @@ class CGraphicContext : public CCriticalSection, \brief */ -XBMC_GLOBAL(CGraphicContext,g_graphicsContext); - +XBMC_GLOBAL_REF(CGraphicContext,g_graphicsContext); +#define g_graphicsContext XBMC_GLOBAL_USE(CGraphicContext) #endif diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index cf39381600546..6475350c42d49 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -400,4 +400,5 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler void setExtraLogLevel(const std::vector &components); }; -XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings); +XBMC_GLOBAL_REF(CAdvancedSettings,g_advancedSettings); +#define g_advancedSettings XBMC_GLOBAL_USE(CAdvancedSettings) diff --git a/xbmc/utils/CharsetConverter.h b/xbmc/utils/CharsetConverter.h index 36777e84ad0fd..ab504099dc722 100644 --- a/xbmc/utils/CharsetConverter.h +++ b/xbmc/utils/CharsetConverter.h @@ -173,6 +173,6 @@ class CCharsetConverter : public ISettingCallback class CInnerConverter; }; -XBMC_GLOBAL(CCharsetConverter,g_charsetConverter); - +XBMC_GLOBAL_REF(CCharsetConverter,g_charsetConverter); +#define g_charsetConverter XBMC_GLOBAL_USE(CCharsetConverter) #endif diff --git a/xbmc/utils/GlobalsHandling.h b/xbmc/utils/GlobalsHandling.h index ab46c58538199..1e18ede49ea21 100644 --- a/xbmc/utils/GlobalsHandling.h +++ b/xbmc/utils/GlobalsHandling.h @@ -212,13 +212,3 @@ namespace xbmcutil * #define g_variable XBMC_GLOBAL_USE(classname) */ #define XBMC_GLOBAL_USE(classname) (*(xbmcutil::GlobalsSingleton::getQuick())) - -/** - * For pattern (1) above, you can use the following macro. WARNING: This should only - * be used when the global in question is never accessed, directly or indirectly, from - * a static method called (again, directly or indirectly) during startup or shutdown. - */ -#define XBMC_GLOBAL(classname,g_variable) \ - XBMC_GLOBAL_REF(classname,g_variable); \ - static classname & g_variable = (*(g_variable##Ref.get())) -