mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 01:06:19 +00:00
Changed: Use static_assert in nlctassert macro if C++0X is supported by compiler
This commit is contained in:
parent
28d1e2538b
commit
e655b0a777
3 changed files with 11 additions and 3 deletions
|
@ -583,7 +583,11 @@ template<class T, class U> inline T type_cast(U o)
|
|||
|
||||
/** Compile time assertion
|
||||
*/
|
||||
#define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0])
|
||||
#ifdef NL_ISO_CPP0X_AVAILABLE
|
||||
# define nlctassert(cond) static_assert(cond, "Compile time assert in "#cond)
|
||||
#else
|
||||
# define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0])
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Allow to verify an object was accessed before its destructor call.
|
||||
|
|
|
@ -117,6 +117,10 @@
|
|||
# define NL_COMP_GCC
|
||||
#endif
|
||||
|
||||
#if defined(_HAS_CPP0X) || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# define NL_ISO_CPP0X_AVAILABLE
|
||||
#endif
|
||||
|
||||
// gcc 3.4 introduced ISO C++ with tough template rules
|
||||
//
|
||||
// NL_ISO_SYNTAX can be used using #if NL_ISO_SYNTAX or #if !NL_ISO_SYNTAX
|
||||
|
|
|
@ -113,8 +113,8 @@ bool CCtrlTextButton::parse(xmlNodePtr cur, CInterfaceGroup * parentGroup)
|
|||
_TextureIdOver[2].setTexture((TxName+"_r.tga").c_str());
|
||||
}
|
||||
|
||||
// Compute Bmp Sizes (crash with VC++ 2010)
|
||||
// nlctassert(NumTexture==3);
|
||||
// Compute Bmp Sizes
|
||||
nlctassert(NumTexture==3);
|
||||
rVR.getTextureSizeFromId(_TextureIdNormal[0], _BmpLeftW, _BmpH);
|
||||
rVR.getTextureSizeFromId(_TextureIdNormal[1], _BmpMiddleW, _BmpH);
|
||||
rVR.getTextureSizeFromId(_TextureIdNormal[2], _BmpRightW, _BmpH);
|
||||
|
|
Loading…
Reference in a new issue