2.8. Predefined Macros. Altium TriCore
Iklan
Iklan
TASKING VX-toolset for TriCore User Guide
#pragma ident "string" or
#ident "string"
2.8. Predefined Macros
The C++ compiler defines a number of preprocessing macros. Many of them are only defined under certain circumstances. This section describes the macros that are provided and the circumstances under which they are defined.
Macro
__ABI_COMPATIBILITY_VERSION
Description
Defines the ABI compatibility version being used. This macro is set to 9999, which means the latest version. This macro is used when building the C++ library.
__ABI_CHANGES_FOR_RTTI
__ABI_CHANGES_FOR_ARRAY_NEW_AND_DELETE This macro is set to TRUE, meaning that the
ABI changes for array new and delete are implemented. This macro is used when building the C++ library.
__ABI_CHANGES_FOR_PLACEMENT_DELETE
This macro is set to TRUE, meaning that the
ABI changes for RTTI are implemented. This macro is used when building the C++ library.
__ARRAY_OPERATORS
__BASE_FILE__
_BOOL
__BUILD__
This macro is set to TRUE, meaning that the
ABI changes for placement delete are implemented. This macro is used when building the C++ library.
Defined when array new
and delete
are enabled. This is the default.
Similar to __FILE__ but indicates the primary source file rather than the current one (i.e., when the current file is an included file).
Defined when bool
is a keyword. This is the default.
Identifies the build number of the C++ compiler, composed of decimal digits for the build number, three digits for the major branch number and three digits for the minor branch number. For example, if you use build 1.22.1
of the compiler, __BUILD__ expands to
1022001. If there is no branch number, the branch digits expand to zero. For example, build 127 results in 127000000.
78
Macro
__CHAR_MIN / __CHAR_MAX
__CPTC__
__cplusplus
__CPU__
__DATE__
__DELTA_TYPE
__DOUBLE_FP__
__embedded_cplusplus
__EXCEPTIONS
__FILE__
__FUNCTION__
__func__
__IMPLICIT_USING_STD
__JMP_BUF_ELEMENT_TYPE
__JMP_BUF_NUM_ELEMENTS
__LINE__
__NAMESPACES
C++ Language
Description
Used in limits.h
to define the minimum/maximum value of a plain char respectively.
Identifies the C++ compiler. You can use this symbol to flag parts of the source which must be recognized by the cptc C++ compiler only.
It expands to 1.
Always defined.
Expands to a string with the CPU supplied with
the option --cpu . When no --cpu is supplied,
this symbol is not defined.
Defined to the date of the compilation in the form "Mmm dd yyyy".
Defines the type of the offset field in the virtual function table. This macro is used when building the C++ library.
Expands to 1 if you did not use
otherwise unrecognized as macro.
Defined as 1 in Embedded C++ mode.
Defined when exception handling is enabled
Expands to the current source file name.
Defined to the name of the current function.
An error is issued if it is used outside of a function.
Same as __FUNCTION__ in GNU mode.
Defined when the standard header files should implicitly do a using-directive on the std namespace (
Specifies the type of an element of the setjmp buffer. This macro is used when building the
C++ library.
Defines the number of elements in the setjmp buffer. This macro is used when building the
C++ library.
Expands to the line number of the line where this macro is called.
Defined when namespaces are supported (this is the default, you can disable support for namespaces with
79
TASKING VX-toolset for TriCore User Guide
Macro
__NO_LONG_LONG
__NULL_EH_REGION_NUMBER
__PLACEMENT_DELETE
__PRETTY_FUNCTION__
__PTRDIFF_MIN / __PTRDIFF_MAX
__REGION_NUMBER_TYPE
__REVISION__
__RTTI
__RUNTIME_USES_NAMESPACES
__SFRFILE__(cpu)
__SIGNED_CHARS__
__SINGLE_FP__
__SIZE_MIN / __SIZE_MAX
__STDC__
__STDC_VERSION__
80
Description
Defined when the long long
type is not supported. This is the default.
Defines the value used as the null region number value in the exception handling tables.
This macro is used when building the C++ library.
Defined when placement delete is enabled.
Defined to the name of the current function.
This includes the return type and parameter types of the function. An error is issued if it is used outside of a function.
Used in stdint.h
to define the minimum/maximum value of a ptrdiff_t type respectively.
Defines the type of a region number field in the exception handling tables. This macro is used when building the C++ library.
Expands to the revision number of the C++ compiler. Digits are represented as they are; characters (for prototypes, alphas, betas) are represented by -1. Examples: v1.0r1 -> 1, v1.0rb -> -1
Defined when RTTI is enabled (
Defined when the run-time uses namespaces.
This macro expands to the filename of the used SFR file, including the < >. The cpu is the argument of the macro. For example, if
--cpu=tc1165 is specified, the macro
__SFRFILE__(__CPU__)
expands to
__SFRFILE__(tc1165)
, which expands to
<regtc1165.sfr>
.
Defined when plain char
is signed.
Expands to 1 if you used
(Treat ‘double’ as ‘float’), otherwise unrecognized as macro.
Used in stdint.h
to define the minimum/maximum value of a size_t
type respectively.
Always defined, but the value may be redefined.
Identifies the ISO-C version number. Expands to 199901L for ISO C99, but the value may be redefined.
Unduh
Iklan