#ifndef COMPILER_H
# define COMPILER_H
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
# include "Compiler_Cfg.h"
/**********************************************************************************************************************
* GLOBAL CONSTANT MACROS
*********************************************************************************************************************/
# define _GREENHILLS_C_RH850_
/* AUTOMATIC used for the declaration of local pointers */
# define AUTOMATIC
/* TYPEDEF shall be used within type definitions, where no memory qualifier can be specified */
# define TYPEDEF
/* NULL_PTR define with a void pointer to zero (the usage does not lead to compile warnings about implicit casts) */
# ifndef NULL_PTR
# define NULL_PTR ((void *)0)
# endif
/* INLINE define for abstraction of the keyword inline */
# define INLINE __inline
/* LOCAL_INLINE define for abstraction of the keyword inline for functions with static scope */
# define LOCAL_INLINE static inline
/* FUNC macro for the declaration and definition of functions
rettype return type of the function
memclass classification of the function itself
*/
# define FUNC(rettype, memclass) rettype
/* FUNC_P2CONST macro for declaration and definition of functions returning a pointer to a constant
rettype return type of the function
ptrclass defines the classification of the pointer's distance
memclass classification of the function itself
*/
# define FUNC_P2CONST(rettype, ptrclass, memclass) const rettype*
/* FUNC_P2VAR macro for the declaration and definition of functions returning a pointer to a variable
rettype return type of the function
ptrclass defines the classification of the pointer's distance
memclass classification of the function itself
*/
# define FUNC_P2VAR(rettype, ptrclass, memclass) rettype*
/* P2VAR macro for the declaration and definition of pointers in RAM, pointing to variables
ptrtype type of the referenced variable memory class
memclass classification of the pointer's variable itself
ptrclass defines the classification of the pointer's distance
*/
# define P2VAR(ptrtype, memclass, ptrclass) ptrtype*
/* P2CONST macro for the declaration and definition of pointers in RAM, pointing to constants
ptrtype type of the referenced data
memclass classification of the pointer's variable itself
ptrclass defines the classification of the pointer's distance
*/
# define P2CONST(ptrtype, memclass, ptrclass) const ptrtype*
/* CONSTP2VAR macro for the declaration and definition of constant pointers accessing variables
ptrtype type of the referenced data
memclass classification of the pointer's variable itself
ptrclass defines the classification of the pointer's distance
*/
# define CONSTP2VAR(ptrtype, memclass, ptrclass) ptrtype *const
/* CONSTP2CONST macro for the declaration and definition of constant pointers accessing constants
ptrtype type of the referenced data
memclass classification of the pointer's variable itself
ptrclass defines the classification of the pointer's distance
*/
# define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype *const
/* P2FUNC macro for the type definition of pointers to functions
rettype return type of the function
ptrclass defines the classification of the pointer's distance
fctname function name respectively name of the defined type
*/
# define P2FUNC(rettype, ptrclass, fctname) rettype (* fctname)
/* CONSTP2FUNC macro for the type definition of constant pointers to functions
rettype return type of the function
ptrclass defines the classification of the pointer's distance
fctname function name respectively name of the defined type
*/
# define CONSTP2FUNC(rettype, ptrclass, fctname) rettype (*const fctname)
/* CONST macro for the declaration and definition of constants
type type of the constant
memclass classification of the constant itself
*/
# define CONST(type, memclass) const type
/* VAR macro for the declaration and definition of variables
vartype type of the variable
memclass classification of the variable itself
*/
# define VAR(vartype, memclass) vartype
/**********************************************************************************************************************
* GLOBAL FUNCTION MACROS
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL DATA TYPES AND STRUCTURES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL DATA PROTOTYPES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL FUNCTION PROTOTYPES
*********************************************************************************************************************/
/* PRQA L:COMPILER_3453_TAG */
/**********************************************************************************************************************
* MISRA deviations
*********************************************************************************************************************/
/* Justification for module-specific MISRA deviations:
MD_Compiler_19.10:
Reason: The macro is used in a scope that does not allow brackets, e.g. declaration of functions and variables.
Risk: Non-atomic parameters lead to compile errors.
Prevention: Used parameters are always atomic.
*/
#endif /* COMPILER_H */
/**********************************************************************************************************************
* END OF FILE: Compiler.h
*********************************************************************************************************************/
恶心的AUTOSAR式宏定义法
最新推荐文章于 2024-05-27 21:00:00 发布