fbxsdk/core/arch/fbxdebug.h Source File
Go to the documentation of this file.
22 #ifndef _FBXSDK_CORE_ARCH_DEBUG_H_
23 #define _FBXSDK_CORE_ARCH_DEBUG_H_
30 #define FBXSDK_ASSERT_ENVSTR "FBXSDK_ASSERT"
37 typedef void (*
FbxAssertProc)(
const char* pFileName,
const char* pFunctionName,
const unsigned int pLineNumber,
const char* pMessage);
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 FBXSDK_DLL void _FbxAssert(
const char* pFileName,
const char* pFunctionName,
const unsigned int pLineNumber,
bool pFormat,
const char* pMessage, ...);
52 FBXSDK_DLL void _FbxTrace(
const char* pMessage, ...);
55 template <
bool x>
struct FbxStaticAssertType;
56 template<>
struct FbxStaticAssertType<true> {
enum{value=1};};
57 template<>
struct FbxStaticAssertType<false> {
enum{value=-1};};
58 #define FBX_ASSERT(Condition) {if(!(Condition)){_FbxAssert(__FILE__,__FUNCTION__,__LINE__,false,#Condition);}}
59 #define FBX_ASSERT_MSG(Condition, Message, ...) {if(!(Condition)){_FbxAssert(__FILE__,__FUNCTION__,__LINE__,true,Message,##__VA_ARGS__);}}
60 #define FBX_ASSERT_NOW(Message, ...) _FbxAssert(__FILE__,__FUNCTION__,__LINE__,true,Message,##__VA_ARGS__);
61 #define FBX_ASSERT_RETURN(Condition) {if(!(Condition)){FBX_ASSERT_NOW(#Condition); return;}}
62 #define FBX_ASSERT_RETURN_VALUE(Condition, Value) {if(!(Condition)){FBX_ASSERT_NOW(#Condition); return Value;}}
63 #define FBX_ASSERT_STATIC(Condition) typedef char FbxBuildBreakIfFalse[FbxStaticAssertType<(bool)(Condition)>::value];
64 #define FBX_TRACE(Message, ...) {_FbxTrace(Message,##__VA_ARGS__);}
66 #define FBX_ASSERT(Condition) ((void)0)
67 #define FBX_ASSERT_MSG(Condition, Message, ...) ((void)0)
68 #define FBX_ASSERT_NOW(Message, ...) ((void)0)
69 #define FBX_ASSERT_RETURN(Condition) if(!(Condition)){return;}
70 #define FBX_ASSERT_RETURN_VALUE(Condition, Value) if(!(Condition)){return Value;}
71 #define FBX_ASSERT_STATIC(Condition)
72 #define FBX_TRACE(Message, ...) ((void)0)
75 template<
typename T>
struct FbxIncompatibleWithArray{
enum {value = 0}; };
77 #define FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)\
78 struct FbxIncompatibleWithArray< T >{\
84 #define FBXSDK_INCOMPATIBLE_WITH_ARRAY(T)\
85 template<> FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)
87 #define FBXSDK_IS_INCOMPATIBLE_WITH_ARRAY(T) ((bool) FbxIncompatibleWithArray<T>::value)
FBX SDK environment definition.
FBXSDK_DLL void FbxAssertSetProc(FbxAssertProc pAssertProc)
Change the procedure used when assertion occurs.
FBXSDK_DLL void FbxAssertSetDefaultProc()
Change the procedure back to the default one.
void(* FbxAssertProc)(const char *pFileName, const char *pFunctionName, const unsigned int pLineNumber, const char *pMessage)
The assertion procedure signature.