]> rtime.felk.cvut.cz Git - arc.git/blob - include/Compiler.h
Added some diab information. Updated Compiler.h to be correct
[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 #elif defined(__DCC__)\r
38 #define CC_EXTENSION\r
39 #endif\r
40 \r
41 #if defined(__GNUC__)\r
42 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
43 #elif defined(__CWCC__)\r
44 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
45 #elif defined(__DCC__)\r
46 #define SECTION_BALIGN(_align )  __attribute__ ((aligned (_align)))\r
47 #endif\r
48 \r
49 #define DECLARE_WEAK                    __attribute__ ((weak))\r
50 \r
51 /* REQ:COMPILER005 */\r
52 #define FUNC(rettype,memclass) rettype\r
53 \r
54 #define P2VAR(ptrtype, memclass, ptrclass) ptrtype *\r
55 \r
56 #define P2CONST(ptrtype, memclass, ptrclass) const ptrtype *\r
57 \r
58 #define CONSTP2VAR(ptrtype,memclass,ptrclass) ptrtype * const\r
59 \r
60 #define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype * const\r
61 \r
62 #define P2FUNC(rettype,ptrclass,fctname) retype (*fctname)\r
63 \r
64 #define CONST(consttype,memclass) const consttype\r
65 \r
66 #define VAR(vartype,memclass) vartype\r
67 \r
68 \r
69 #endif /* COMPILER_H */ \r