sewardj | 5cf515f | 2004-06-26 20:10:35 +0000 | [diff] [blame] | 1 | |
| 2 | /*---------------------------------------------------------------*/ |
| 3 | /*--- ---*/ |
sewardj | ac9af02 | 2004-07-05 01:15:34 +0000 | [diff] [blame^] | 4 | /*--- This file (util.h) is ---*/ |
sewardj | 5cf515f | 2004-06-26 20:10:35 +0000 | [diff] [blame] | 5 | /*--- Copyright (c) 2004 OpenWorks LLP. All rights reserved. ---*/ |
| 6 | /*--- ---*/ |
| 7 | /*---------------------------------------------------------------*/ |
| 8 | |
sewardj | ac9af02 | 2004-07-05 01:15:34 +0000 | [diff] [blame^] | 9 | #ifndef __LIBJIT_UTIL_H |
| 10 | #define __LIBJIT_UTIL_H |
sewardj | 5cf515f | 2004-06-26 20:10:35 +0000 | [diff] [blame] | 11 | |
sewardj | ac9af02 | 2004-07-05 01:15:34 +0000 | [diff] [blame^] | 12 | #include "libjit_basictypes.h" |
sewardj | 5cf515f | 2004-06-26 20:10:35 +0000 | [diff] [blame] | 13 | |
| 14 | |
| 15 | /* Stuff for panicking and assertion. */ |
| 16 | |
| 17 | #define VG__STRING(__str) #__str |
| 18 | |
| 19 | #define assert(expr) \ |
| 20 | ((void) ((expr) ? 0 : \ |
| 21 | (vex_assert_fail (VG__STRING(expr), \ |
| 22 | __FILE__, __LINE__, \ |
| 23 | __PRETTY_FUNCTION__), 0))) |
| 24 | |
| 25 | __attribute__ ((__noreturn__)) |
| 26 | extern void vex_assert_fail ( const Char* expr, const Char* file, |
| 27 | Int line, const Char* fn ); |
| 28 | __attribute__ ((__noreturn__)) |
| 29 | extern void panic ( Char* str ); |
| 30 | |
| 31 | |
sewardj | ac9af02 | 2004-07-05 01:15:34 +0000 | [diff] [blame^] | 32 | #endif /* ndef __LIBJIT_UTIL_H */ |
| 33 | |
| 34 | /*---------------------------------------------------------------*/ |
| 35 | /*--- util.h ---*/ |
| 36 | /*---------------------------------------------------------------*/ |