-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompiler.h
More file actions
82 lines (52 loc) · 3.25 KB
/
Compiler.h
File metadata and controls
82 lines (52 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/******************************************************************************
*
* Module: Common - Compiler Abstraction
*
* File Name: Compiler.h
*
* Description: This file contains the definitions and macros specified by
* AUTOSAR for the abstraction of compiler specific keywords.
*
* Author: Mohamed Tarek
*
*******************************************************************************/
#ifndef COMPILER_H
#define COMPILER_H
/* Id for the company in the AUTOSAR
* for example Mohamed Tarek's ID = 1000 :) */
#define COMPILER_VENDOR_ID (2020U)
/*
* Module Version 1.0.0
*/
#define COMPILER_SW_MAJOR_VERSION (1U)
#define COMPILER_SW_MINOR_VERSION (0U)
#define COMPILER_SW_PATCH_VERSION (0U)
/*
* AUTOSAR Version 4.0.3
*/
#define COMPILER_AR_RELEASE_MAJOR_VERSION (4U)
#define COMPILER_AR_RELEASE_MINOR_VERSION (3U)
#define COMPILER_AR_RELEASE_PATCH_VERSION (1U)
/*********************************************************************/
/* 8.2.1 */
#define NULL_PTR ((void*) 0x0)
#define AUTOMATIC /* used as input for memory class (memclass) and pointer class (ptrclass) when no input from Compiler_Cfg.h is needed */
#define TYPEDEF /* used with typedef keyword in as input for memory class (of compiler)because with typedef we cannot use them */
#define INLINE inline
#define LOCAL_INLINE static inline
/* 8.2.2 function definition use it to define functions */
#define FUNC( rettype, memclass ) rettype /* for the declaration and definition of functions */
#define FUNC_P2CONST(rettype, ptrclass, memclass) const rettype * /* declaration and definition of functions returning a pointer to a constant */
#define FUNC_P2VAR(rettype, ptrclass, memclass) rettype * /* for the declaration and definition of functions returning a pointer to a variable */
/* 8.2.3 Pointer definitions use it to define pointers */
#define P2VAR(ptrtype, memclass, ptrclass) ptrtype * /* for the declaration and definition of pointers in RAM, pointing to variables */
#define P2CONST(ptrtype, memclass, ptrclass) const ptrtype* /* for the declaration and definition of pointers in RAM pointing to constants */
#define CONSTP2VAR(ptrtype, memclass, ptrclass) ptrtype * const /* for the declaration and definition of constant pointers accessing variables */
#define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype * const /* for the declaration and definition of constant pointers accessing constants */
#define P2FUNC(rettype, ptrclass, fctname) rettype (* fctname) /* for the type definition of pointers to functions */ /* fctname is pointer to function name*/
#define CONSTP2FUNC(rettype, ptrclass, fctname) rettype (* const fctname) /* the type definition of constant pointers to functions */ /* fctname is pointer to function name*/
/* 8.2.4 Constant definitions use it to define Constants */
#define CONST(type, memclass) const type /* for the declaration and definition of constants */
/* 8.2.4 Variable definitions use it to define Variables */
#define VAR( type, memclass ) type /* for the declaration and definition of constants */
#endif