1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
24 /* See CopmpilerAbstraction.pdf */
\r
28 /* REQ:COMPILER040,049,051 */
\r
30 #define STATIC static
\r
31 #define NULL_PTR ((void *)0)
\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
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
50 #define DECLARE_WEAK __attribute__ ((weak))
\r
52 /* Does this really work on all compilers.... */
\r
53 #define INLINE __inline__
\r
55 /* REQ:COMPILER005 */
\r
56 #define FUNC(rettype,memclass) rettype
\r
58 #define P2VAR(ptrtype, memclass, ptrclass) ptrtype *
\r
60 #define P2CONST(ptrtype, memclass, ptrclass) const ptrtype *
\r
62 #define CONSTP2VAR(ptrtype,memclass,ptrclass) ptrtype * const
\r
64 #define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype * const
\r
66 #define P2FUNC(rettype,ptrclass,fctname) rettype (*fctname)
\r
68 #define CONST(consttype,memclass) const consttype
\r
70 #define VAR(vartype,memclass) vartype
\r
73 #endif /* COMPILER_H */
\r