]> rtime.felk.cvut.cz Git - arc.git/blob - include/Compiler.h
Regenerated examples. Removed linux board. Added default cross compiler for TI.
[arc.git] / include / Compiler.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 \r
24 /* See CopmpilerAbstraction.pdf */\r
25 #ifndef COMPILER_H\r
26 #define COMPILER_H\r
27 \r
28 /* REQ:COMPILER040,049,051 */\r
29 #define AUTOMATIC\r
30 #define STATIC  static\r
31 #define NULL_PTR        ((void *)0)\r
32 \r
33 #if defined(__GNUC__)\r
34 #define CC_EXTENSION    __extension__\r
35 #elif defined(__CWCC__)\r
36 #define CC_EXTENSION\r
37 #pragma read_only_switch_tables on\r
38 #elif defined(__DCC__)\r
39 #define CC_EXTENSION\r
40 #endif\r
41 \r
42 #if defined(__GNUC__)\r
43 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
44 #elif defined(__CWCC__)\r
45 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
46 #elif defined(__DCC__)\r
47 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
48 #endif\r
49 \r
50 #define DECLARE_WEAK                    __attribute__ ((weak))\r
51 \r
52 /* Does this really work on all compilers.... */\r
53 #define INLINE __inline__\r
54 \r
55 /* REQ:COMPILER005 */\r
56 #define FUNC(rettype,memclass) rettype\r
57 \r
58 #define P2VAR(ptrtype, memclass, ptrclass) ptrtype *\r
59 \r
60 #define P2CONST(ptrtype, memclass, ptrclass) const ptrtype *\r
61 \r
62 #define CONSTP2VAR(ptrtype,memclass,ptrclass) ptrtype * const\r
63 \r
64 #define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype * const\r
65 \r
66 #define P2FUNC(rettype,ptrclass,fctname) rettype (*fctname)\r
67 \r
68 #define CONST(consttype,memclass) const consttype\r
69 \r
70 #define VAR(vartype,memclass) vartype\r
71 \r
72 \r
73 #endif /* COMPILER_H */ \r