Changeset 2398 for box/trunk/lib/common/Box.h
- Timestamp:
- 05/12/2008 20:32:09 (3 years ago)
- File:
-
- 1 edited
-
box/trunk/lib/common/Box.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/Box.h
r2169 r2398 43 43 #define ASSERT_FAILS_TO_SYSLOG_ON {AssertFailuresToSyslog = true;} 44 44 void BoxDebugAssertFailed(const char *cond, const char *file, int line); 45 #define ASSERT(cond) {if(!(cond)) {BoxDebugAssertFailed(#cond, __FILE__, __LINE__); THROW_EXCEPTION(CommonException, AssertFailed)}} 45 #define ASSERT(cond) \ 46 { \ 47 if(!(cond)) \ 48 { \ 49 BoxDebugAssertFailed(#cond, __FILE__, __LINE__); \ 50 THROW_EXCEPTION_MESSAGE(CommonException, \ 51 AssertFailed, #cond); \ 52 } \ 53 } 46 54 47 55 // Note that syslog tracing is independent of BoxDebugTraceOn, … … 97 105 { \ 98 106 OPTIONAL_DO_BACKTRACE \ 99 BOX_WARNING("Exception thrown: " #type "(" #subtype ") at" \100 __FILE__ "(" << __LINE__ << ")") \107 BOX_WARNING("Exception thrown: " #type "(" #subtype ") " \ 108 "at " __FILE__ "(" << __LINE__ << ")") \ 101 109 throw type(type::subtype); \ 102 110 } 103 111 112 #define THROW_EXCEPTION_MESSAGE(type, subtype, message) \ 113 { \ 114 OPTIONAL_DO_BACKTRACE \ 115 BOX_WARNING("Exception thrown: " #type "(" #subtype ") " \ 116 " (" message ") at " \ 117 __FILE__ "(" << __LINE__ << ")") \ 118 throw type(type::subtype, message); \ 119 } 120 104 121 // extra macros for converting to network byte order 105 106 122 #ifdef HAVE_NETINET_IN_H 107 123 #include <netinet/in.h>
Note: See TracChangeset
for help on using the changeset viewer.
