Changeset 0720e049 for src/include/cassert
- Timestamp:
- Aug 11, 2017, 10:33:37 AM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 54cd58b0
- Parents:
- 3d4b23fa (diff), 59a75cb (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/include/cassert
r3d4b23fa r0720e049 10 10 // Created On : Thu Aug 18 13:19:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Aug 18 13:25:55 201613 // Update Count : 412 // Last Modified On : Tue Aug 1 11:56:01 2017 13 // Update Count : 16 14 14 // 15 15 … … 18 18 // IWYU pragma: private, include <cassert> 19 19 20 #include_next < assert.h>20 #include_next <cassert> 21 21 22 #define __STRINGIFY__(str) #str 23 #define __VSTRINGIFY__(str) __STRINGIFY__(str) 24 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ )) 22 #ifdef NDEBUG 25 23 26 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn)); 24 #define assertf(expr, fmt, ...) (__ASSERT_VOID_ASSERT (0)) 25 26 #else 27 28 #define assertf(expr, fmt, ...) ((expr) \ 29 ? (__ASSERT_VOID_CAST (0)) \ 30 : __assert_fail_f( #expr, __FILE__, __LINE__, \ 31 __ASSERT_FUNCTION, fmt, ## __VA_ARGS__ )) 32 33 void __assert_fail_f( const char *assertion, const char *file, 34 unsigned int line, const char *function, 35 const char *fmt, ... 36 ) __attribute__((noreturn, format(printf, 5, 6))); 37 38 #endif 27 39 28 40 template<typename T, typename U> 29 static inline T safe_dynamic_cast( const U& src) {41 static inline T safe_dynamic_cast( const U & src ) { 30 42 T ret = dynamic_cast<T>(src); 31 43 assert(ret);
Note:
See TracChangeset
for help on using the changeset viewer.