00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017 #if !defined(OPENNURBS_ERROR_INC_)
00018 #define OPENNURBS_ERROR_INC_
00019
00020
00021
00022
00023
00024
00025 #if defined(__FUNCTION__)
00026
00027 #define ON_ERROR(msg) ON_ErrorEx(__FILE__,__LINE__,__FUNCTION__,msg)
00028 #define ON_WARNING(msg) ON_WarningEx(__FILE__,__LINE__,__FUNCTION__,msg)
00029 #define ON_ASSERT(cond) ON_AssertEx(cond,__FILE__,__LINE__,__FUNCTION__, #cond " is false")
00030 #define ON_ASSERT_OR_RETURN(cond,returncode) do{if (!(cond)) {ON_AssertEx(false,__FILE__,__LINE__,__FUNCTION__, #cond " is false");return(returncode);}}while(0)
00031 #else
00032
00033 #define ON_ERROR(msg) ON_Error(__FILE__,__LINE__,msg)
00034 #define ON_WARNING(msg) ON_Warning(__FILE__,__LINE__,msg)
00035 #define ON_ASSERT(cond) ON_Assert(cond,__FILE__,__LINE__, #cond " is false")
00036 #define ON_ASSERT_OR_RETURN(cond,returncode) do{if (!(cond)) {ON_Assert(false,__FILE__,__LINE__, #cond " is false");return(returncode);}}while(0)
00037 #endif
00038
00039
00040 ON_BEGIN_EXTERNC
00041
00042
00043
00044
00045
00046
00047 ON_DECL
00048 void ON_ErrorMessage(
00049 int,
00050 const char*
00051 );
00052
00053
00054
00055
00056
00057 ON_DECL
00058 int ON_GetErrorCount(void);
00059
00060
00061
00062
00063
00064 ON_DECL
00065 int ON_GetWarningCount(void);
00066
00067
00068
00069
00070
00071
00072 ON_DECL
00073 int ON_GetMathErrorCount(void);
00074
00075 ON_DECL
00076 int ON_GetDebugErrorMessage(void);
00077
00078 ON_DECL
00079 void ON_EnableDebugErrorMessage( int bEnableDebugErrorMessage );
00080
00081
00082 ON_DECL
00083 void ON_Error( const char*,
00084 int,
00085 const char*,
00086 ...
00087 );
00088
00089 ON_DECL
00090 void ON_ErrorEx( const char*,
00091 int,
00092 const char*,
00093 const char*,
00094 ...
00095 );
00096 ON_DECL
00097 void ON_Warning( const char*,
00098 int,
00099 const char*,
00100 ...
00101 );
00102 ON_DECL
00103 void ON_WarningEx( const char*,
00104 int,
00105 const char*,
00106 const char*,
00107 ...
00108 );
00109
00110
00111 ON_DECL
00112 void ON_Assert( int,
00113 const char*,
00114 int,
00115 const char*,
00116 ...
00117 );
00118
00119 ON_DECL
00120 void ON_AssertEx( int,
00121 const char*,
00122 int,
00123 const char*,
00124 const char*,
00125 ...
00126 );
00127
00128 ON_DECL
00129 void ON_MathError(
00130 const char*,
00131 const char*,
00132 const char*
00133 );
00134
00135 ON_END_EXTERNC
00136
00137 #endif