1 /***************************************************************************
2 compiler.h - compiler-dependent definitions
4 begin : mer ott 18 2005
5 copyright : (C) 2005-2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef __COMPILER_H__
19 #define __COMPILER_H__
25 #define PACKED __attribute__((packed))
26 #define ALIGN(x) __attribute__((aligned (x)))
27 #define PRINTF(x,y) __attribute__ ((__format__ (__printf__, x, y)))
29 #define TRAP asm("int $0x03\n\t")
33 #define ASSERT(x) ({if(!(x)){ printf("Assertion " #x " failed\n" \
34 "in %s, line %d of file %s\n", __PRETTY_FUNCTION__, \
35 __LINE__, __FILE__); system("kdialog --error 'Crash!'"); TRAP; }; 0;})
38 #define ASSERT(x) ({})
51 #endif //__COMPILER_H__