Warning: you were redirected to the latest documentation corresponding to your major release ( 2024.1.1.8691 ). Should you wish to access your specific version's documentation, please download the offline documentation from the Audiokinetic Launcher and check the Offline Documentation option in Wwise Authoring.
Go to the documentation of this file.
27 #ifndef _AK_AKASSERT_H_
28 #define _AK_AKASSERT_H_
30 #if defined( _DEBUG ) && !(defined AK_DISABLE_ASSERTS)
31 #ifndef AK_ENABLE_ASSERTS
32 #define AK_ENABLE_ASSERTS
36 #ifdef AK_ENABLE_ASSERTS
38 #ifndef AK_ASSERT_HOOK
40 const char * in_pszExpression,
41 const char * in_pszFileName,
44 #define AK_ASSERT_HOOK
48 #if !defined( AKASSERT )
51 #if defined( AK_ENABLE_ASSERTS )
55 #define AKASSERT(Condition) ((Condition) ? ((void) 0) : g_pAssertHook( #Condition, __FILE__, __LINE__) )
57 #define AKVERIFY AKASSERT
60 #define AKASSERTD AKASSERT
62 #define AKASSERTD(Condition) ((void)0)
65 #else // defined( AK_ENABLE_ASSERTS )
67 #define AKASSERT(Condition) do { switch ( 0 ) { case 0: break; default: if ( !( Condition ) ) {} } } while ( 0 )
69 #define AKVERIFY(x) ((void)(x))
72 #define AKASSERTD AKASSERT
74 #define AKASSERTD(Condition) ((void)0)
77 #endif // defined( AK_ENABLE_ASSERTS )
79 #define AKASSERT_RANGE(Value, Min, Max) (AKASSERT(((Value) >= (Min)) && ((Value) <= (Max))))
81 #define AKASSERTANDRETURN( __Expression, __ErrorCode )\
84 AKASSERT(__Expression);\
88 #define AKASSERTPOINTERORFAIL( __Pointer ) AKASSERTANDRETURN( __Pointer != NULL, AK_Fail )
89 #define AKASSERTSUCCESSORRETURN( __akr ) AKASSERTANDRETURN( __akr == AK_Success, __akr )
91 #define AKASSERTPOINTERORRETURN( __Pointer ) \
92 if ((__Pointer) == NULL)\
94 AKASSERT((__Pointer) == NULL);\
98 #if defined( AK_WIN ) && ( _MSC_VER >= 1600 )
100 #define AKSTATICASSERT( __expr__, __msg__ ) static_assert( (__expr__), (__msg__) )
103 #define AKSTATICASSERT( __expr__, __msg__ ) typedef char __AKSTATICASSERT__[(__expr__)?1:-1]
106 #endif // ! defined( AKASSERT )
108 #ifdef AK_ENABLE_ASSERTS
112 #define DEFINEDUMMYASSERTHOOK void AkAssertHookFunc( \
113 const char* in_pszExpression,\
114 const char* in_pszFileName,\
119 AkAssertHook g_pAssertHook = AkAssertHookFunc;
121 #define DEFINEDUMMYASSERTHOOK
#define AKSOUNDENGINE_API
#define AK_CALLBACK(_type, _name)
void(* AkAssertHook)(const char *in_pszExpression, const char *in_pszFileName, int in_lineNumber)
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise