git-svn-id: svn://ultimatepp.org/upp/trunk@346 f0d560ea-af0d-0410-9eb7-867de7ffcac7

This commit is contained in:
cxl 2008-08-16 18:43:33 +00:00
parent 2383192b1a
commit 0c6e098d63
186 changed files with 44447 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#define GLOBAL_VP(type, name, param) \
name() \
{ \
static type x param; \
return x; \
}
#define GLOBAL_VARP(type, name, param) \
type& GLOBAL_VP(type, name, param)
#define GLOBAL_V(type, name) GLOBAL_VP(type, name, init_)
#define GLOBAL_VAR(type, name) type& GLOBAL_V(type, name)
#define GLOBAL_VP_INIT(type, name, param) \
name() \
{ \
static type x param; \
return x; \
} \
INITBLOCK { name(); }
#define GLOBAL_VARP_INIT(type, name, param) \
type& GLOBAL_VP_INIT(type, name, param)
#define GLOBAL_V_INIT(type, name) GLOBAL_VP_INIT(type, name, init_)
#define GLOBAL_VAR_INIT(type, name) type& GLOBAL_V_INIT(type, name)
// DEPRECATED! (USE ONCELOCK_)
#define INIT_LOCKV(init, code) \
if(!init) { \
static StaticCriticalSection cs; \
CriticalSection::Lock __(cs); \
if(!init) { \
init = true; \
code \
} \
}
// DEPRECATED! (USE ONCELOCK)
#define INIT_LOCK(code) \
static bool init; \
INIT_LOCKV(init, code)