aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since d6c1dd0 was
d6c1dd0,
checked in by Peter A. Buhr <pabuhr@…>, 6 years ago
|
formatting and add attribute "format" to C++ assert_fail_f
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[12756de] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
[4f147cc] | 6 | // |
---|
| 7 | // assert.h -- |
---|
| 8 | // |
---|
[12756de] | 9 | // Author : Peter A. Buhr |
---|
| 10 | // Created On : Thu Aug 18 13:19:26 2016 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[d6c1dd0] | 12 | // Last Modified On : Tue Aug 1 11:56:01 2017 |
---|
| 13 | // Update Count : 16 |
---|
[4f147cc] | 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
[bf2438c] | 17 | // Pragmas for header cleanup tool |
---|
| 18 | // IWYU pragma: private, include <cassert> |
---|
[12756de] | 19 | |
---|
| 20 | #include_next <assert.h> |
---|
| 21 | |
---|
| 22 | #define __STRINGIFY__(str) #str |
---|
| 23 | #define __VSTRINGIFY__(str) __STRINGIFY__(str) |
---|
[d6c1dd0] | 24 | #define assertf( expr, fmt, ... ) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ )) |
---|
[12756de] | 25 | |
---|
[d6c1dd0] | 26 | void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn, format( printf, 5, 6) )); |
---|
[12756de] | 27 | |
---|
[4f147cc] | 28 | template<typename T, typename U> |
---|
[d6c1dd0] | 29 | static inline T safe_dynamic_cast( const U & src ) { |
---|
[4f147cc] | 30 | T ret = dynamic_cast<T>(src); |
---|
| 31 | assert(ret); |
---|
| 32 | return ret; |
---|
| 33 | } |
---|
| 34 | |
---|
[12756de] | 35 | // Local Variables: // |
---|
| 36 | // tab-width: 4 // |
---|
| 37 | // mode: c++ // |
---|
| 38 | // compile-command: "make install" // |
---|
| 39 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.