Removed killer, just use history. small cleanup.
[rattatechess.git] / compiler.h
blob0e2d96a2032829f46b86e5b40aefd097be1ab0fe
1 /***************************************************************************
2 compiler.h - compiler-dependent definitions
3 -------------------
4 begin : mer ott 18 2005
5 copyright : (C) 2005-2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #ifndef __COMPILER_H__
19 #define __COMPILER_H__
21 #ifdef __GNUC__
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")
29 #ifdef DEBUG
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;})
34 #else //DEBUG
36 #define ASSERT(x) ({})
37 #endif //DEBUG
39 #else
41 #define PACKED
42 #define ALIGN(x)
43 #define PRINTF(x,y)
44 #define TRAP
45 #define ASSERT(x)
47 #endif //0
49 #endif //__COMPILER_H__