J1939 Documentation
Version 4.16.00
Loading...
Searching...
No Matches
mc_compiler.h File Reference

Detailed Description

Due to different implementations of data types in the world of C compilers, the following data types are used:

  • bool_t : Boolean value, True or False
  • uint8_t : 1 Byte value, value range 0 .. 28 - 1 (0 .. 255)
  • int8_t : 1 Byte value, value range -27 .. 27 - 1 (-128 .. 127)
  • uint16_t : 2 Byte value, value range 0 .. 216 - 1 (0 .. 65535)
  • int16_t : 2 Byte value, value range -215 .. 215 - 1
  • uint32_t : 4 Byte value, value range 0 .. 232 - 1
  • int32_t : 4 Byte value, value range -231 .. 231 - 1
  • uint64_t : 8 Byte value, value range 0 .. 264 - 1
  • int64_t : 8 Byte value, value range -263 .. 263 - 1

The compiler type/version is evaluated via its internal predefined symbols. If your compiler is not (yet) supported, you will get the following error message upon compilation:

Data types are not defined! Please check compiler definition.

For GNU C compiler the predefined symbols can be obtained by the following command:

gcc -dM -E - < /dev/null

The following C compilers are supported by this file:

  • Fujitsu C compiler for 16LX/16FX series (Softune)
  • GNU C for Apple Mac-OS (Darwin)
  • GNU C for ARM controller
  • GNU C for Atmel AVR controller
  • GNU C for Atmel AVR32 controller
  • GNU C for ColdFire controller
  • GNU C for Linux
  • GNU C for PowerPC CPU (VxWorks)
  • GNU C for TriCore controller
  • Hi-Tech PICC18 for Microchip PIC18 controller
  • IAR C compiler for ARM controller
  • IAR C compiler for Renesas RX controller
  • Imagecraft C compiler for Atmel AVR controller
  • Keil C compiler for 8051 controller
  • Keil C compiler for 80C16x controller
  • Keil C compiler for ARM controller
  • Metrowerks C compiler
  • Microchip MPLAB C18 compiler for PIC18
  • Microchip C30 compiler for PIC24 and dsPIC
  • Microchip XC16 compiler for PIC24 and dsPIC
  • Microchip XC32 compiler for PIC32
  • Microsoft Visual C/C++ compiler
  • National Instruments CVI compiler
  • Renesas NC30 compiler for R8C and M16C controller
  • Renesas RX compiler
  • Texas Instruments ARM compiler
  • Texas Instruments TMS320C28x compiler
+ Include dependency graph for mc_compiler.h:

Data Structures

union  Float_u
 

Macros

#define CPP_CONST   const
 
#define CPP_DATA_SIZE   64
 
#define CPP_INLINE   __inline
 
#define CPP_PACK   __attribute__((packed))
 
#define CPP_PARM_UNUSED(x)   UNUSED_ ## x __attribute__((unused))
 
#define CPP_SECTION
 

Typedefs

typedef int32_t Status_tv
 

Macro Definition Documentation

◆ CPP_CONST

#define CPP_CONST   const

The symbol CPP_CONST defines the expression for keeping data in the flash area.

◆ CPP_DATA_SIZE

#define CPP_DATA_SIZE   64

The symbol CPP_DATA_SIZE defines the largest supported data size (in bits) of the compiler. Typical values are 32 or 64. The data types uint64_t and int64_t are not supported if CPP_DATA_SIZE is 32.

◆ CPP_INLINE

#define CPP_INLINE   __inline

The symbol CPP_INLINE is used to declare a function as inline.

◆ CPP_PACK

#define CPP_PACK   __attribute__((packed))

The symbol CPP_PACK is used to pack data structures.

◆ CPP_PARM_UNUSED

#define CPP_PARM_UNUSED ( x)    UNUSED_ ## x __attribute__((unused))

The macro CPP_PARM_UNUSED is used to specify function parameters which are currently not used.

◆ CPP_SECTION

#define CPP_SECTION

The macro CPP_SECTION is used to specify the memory section for the linker.

Typedef Documentation

◆ Status_tv

typedef int32_t Status_tv

Data type for status value.

The Status_tv typedef defines the data type for status values, typically used as return values. In order to keep the overhead small for different target platforms the data type can be adjusted.

Setting the symbol MC_COMPILER_EXT_H_ allows to include an external header file named "mc_compiler_ext.h".