Skip to content

Commit

Permalink
[globals] remove macro XBMC_GLOBAL
Browse files Browse the repository at this point in the history
  • Loading branch information
mkortstiege committed Oct 28, 2015
1 parent e83e2f9 commit 92b136d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
4 changes: 2 additions & 2 deletions xbmc/guilib/GraphicContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion xbmc/settings/AdvancedSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,5 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
void setExtraLogLevel(const std::vector<CVariant> &components);
};

XBMC_GLOBAL(CAdvancedSettings,g_advancedSettings);
XBMC_GLOBAL_REF(CAdvancedSettings,g_advancedSettings);
#define g_advancedSettings XBMC_GLOBAL_USE(CAdvancedSettings)
4 changes: 2 additions & 2 deletions xbmc/utils/CharsetConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 0 additions & 10 deletions xbmc/utils/GlobalsHandling.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,3 @@ namespace xbmcutil
* #define g_variable XBMC_GLOBAL_USE(classname)
*/
#define XBMC_GLOBAL_USE(classname) (*(xbmcutil::GlobalsSingleton<classname>::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()))

0 comments on commit 92b136d

Please sign in to comment.