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__
23 #define PACKED __attribute__((packed))
24 #define ALIGN(x) __attribute__((aligned (x)))
25 #define PRINTF(x,y) __attribute__ ((__format__ (__printf__, x, y)))
27 #define TRAP asm("int $0x03\n\t")
31 #define ASSERT(x) ({if(!(x)){ printf("Assertion " #x " failed\n" \
32 "in %s, line %d of file %s\n", __PRETTY_FUNCTION__, \
33 __LINE__, __FILE__); system("kdialog --error 'Crash!'"); TRAP; }; 0;})
36 #define ASSERT(x) ({})
49 #endif //__COMPILER_H__