blob: 73eca365df8eef4127f24453bafb30623ba8766d [file] [log] [blame]
sewardj5cf515f2004-06-26 20:10:35 +00001
2/*---------------------------------------------------------------*/
3/*--- ---*/
sewardjac9af022004-07-05 01:15:34 +00004/*--- This file (util.h) is ---*/
sewardj5cf515f2004-06-26 20:10:35 +00005/*--- Copyright (c) 2004 OpenWorks LLP. All rights reserved. ---*/
6/*--- ---*/
7/*---------------------------------------------------------------*/
8
sewardjac9af022004-07-05 01:15:34 +00009#ifndef __LIBJIT_UTIL_H
10#define __LIBJIT_UTIL_H
sewardj5cf515f2004-06-26 20:10:35 +000011
sewardjac9af022004-07-05 01:15:34 +000012#include "libjit_basictypes.h"
sewardj5cf515f2004-06-26 20:10:35 +000013
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__))
26extern void vex_assert_fail ( const Char* expr, const Char* file,
27 Int line, const Char* fn );
28__attribute__ ((__noreturn__))
29extern void panic ( Char* str );
30
31
sewardjac9af022004-07-05 01:15:34 +000032#endif /* ndef __LIBJIT_UTIL_H */
33
34/*---------------------------------------------------------------*/
35/*--- util.h ---*/
36/*---------------------------------------------------------------*/