FBX C++ API Reference
fbxdebug.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
22 #ifndef _FBXSDK_CORE_ARCH_DEBUG_H_
23 #define _FBXSDK_CORE_ARCH_DEBUG_H_
24 
25 #include <fbxsdk/fbxsdk_def.h>
26 
27 #include <fbxsdk/fbxsdk_nsbegin.h>
28 
30 #define FBXSDK_ASSERT_ENVSTR "FBXSDK_ASSERT"
31 
37 typedef void (*FbxAssertProc)(const char* pFileName, const char* pFunctionName, const unsigned int pLineNumber, const char* pMessage);
38 
41 FBXSDK_DLL void FbxAssertSetProc(FbxAssertProc pAssertProc);
42 
45 
46 /*****************************************************************************************************************************
47 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
48 *****************************************************************************************************************************/
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 
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, ...);
53 
54 #ifdef _DEBUG
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__);}
65 #else
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)
73 #endif
74 
75 template<typename T> struct FbxIncompatibleWithArray{ enum {value = 0}; };
76 
77 #define FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)\
78  struct FbxIncompatibleWithArray< T >{\
79  union {\
80  T t();\
81  } catcherr;\
82  enum {value = 1};}
83 
84 #define FBXSDK_INCOMPATIBLE_WITH_ARRAY(T)\
85  template<> FBXSDK_INCOMPATIBLE_WITH_ARRAY_TEMPLATE(T)
86 
87 #define FBXSDK_IS_INCOMPATIBLE_WITH_ARRAY(T) ((bool) FbxIncompatibleWithArray<T>::value)
88 
89 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
90 
91 #include <fbxsdk/fbxsdk_nsend.h>
92 
93 #endif /* _FBXSDK_CORE_ARCH_DEBUG_H_ */
FBX SDK environment definition.
void FbxAssertSetProc(FbxAssertProc pAssertProc)
Change the procedure used when assertion occurs.
void(* FbxAssertProc)(const char *pFileName, const char *pFunctionName, const unsigned int pLineNumber, const char *pMessage)
The assertion procedure signature.
Definition: fbxdebug.h:37
#define FBXSDK_DLL
Definition: fbxarch.h:173
void FbxAssertSetDefaultProc()
Change the procedure back to the default one.