sewardj | 5cf515f | 2004-06-26 20:10:35 +0000 | [diff] [blame^] | 1 | |
| 2 | /*---------------------------------------------------------------*/ |
| 3 | /*--- ---*/ |
| 4 | /*--- This file (basictypes.h) is ---*/ |
| 5 | /*--- Copyright (c) 2004 OpenWorks LLP. All rights reserved. ---*/ |
| 6 | /*--- ---*/ |
| 7 | /*---------------------------------------------------------------*/ |
| 8 | |
| 9 | #ifndef __BASICTYPES_H |
| 10 | #define __BASICTYPES_H |
| 11 | |
| 12 | typedef unsigned char UChar; |
| 13 | typedef char Char; /* platform-dependent signfulness */ |
| 14 | |
| 15 | typedef unsigned short UShort; |
| 16 | typedef signed short Short; |
| 17 | |
| 18 | typedef unsigned int UInt; |
| 19 | typedef signed int Int; |
| 20 | |
| 21 | typedef unsigned long long int ULong; |
| 22 | typedef signed long long int Long; |
| 23 | |
| 24 | typedef unsigned char Bool; |
| 25 | #define True ((Bool)1) |
| 26 | #define False ((Bool)0) |
| 27 | |
| 28 | |
| 29 | /* Stuff for panicking and assertion. */ |
| 30 | |
| 31 | #define VG__STRING(__str) #__str |
| 32 | |
| 33 | #define assert(expr) \ |
| 34 | ((void) ((expr) ? 0 : \ |
| 35 | (vex_assert_fail (VG__STRING(expr), \ |
| 36 | __FILE__, __LINE__, \ |
| 37 | __PRETTY_FUNCTION__), 0))) |
| 38 | |
| 39 | __attribute__ ((__noreturn__)) |
| 40 | extern void vex_assert_fail ( const Char* expr, const Char* file, |
| 41 | Int line, const Char* fn ); |
| 42 | __attribute__ ((__noreturn__)) |
| 43 | extern void panic ( Char* str ); |
| 44 | |
| 45 | |
| 46 | #endif /* ndef __BASICTYPES_H */ |