9.150 Predefined macros
9.150 Predefined macros
The ARM compiler predefines a number of macros. These macros provide information about toolchain version numbers and compiler options.
Table 9-21 Predefined macros
Name | Value | When defined |
---|---|---|
__arm __ |
- |
Always defined for the ARM compiler, even when you specify the
--thumb option.See also
__ARMCC_VERSION . |
__ARMCC_VERSION |
ver |
Always defined. It is a decimal number, and is guaranteed to increase between releases. The format is
PVVbbbb where:
NoteUse this macro to distinguish between ARM Compiler 4.1 or later, and other tools that define
__arm__ . |
__APCS_INTERWORK |
- |
When you specify the
--apcs /interwork option or set the target processor architecture to ARMv5T or later. |
__APCS_ROPI |
- |
When you specify the
--apcs /ropi option. |
__APCS_RWPI |
- |
When you specify the
--apcs /rwpi option. |
__APCS_FPIC |
- |
When you specify the
--apcs /fpic option. |
__ARRAY_OPERATORS |
- | In C++ compiler mode, to specify that array new and delete are enabled. |
__BASE_FILE__ |
name |
Always defined. Similar to
__FILE__ , but indicates the primary source file rather than the current one (that is, when the current file is an included file). |
__BIG_ENDIAN |
- | If compiling for a big-endian target. |
_BOOL |
- |
In C++ compiler mode, to specify that
bool is a keyword. |
__cplusplus |
- | In C++ compiler mode. |
__CC_ARM |
1 |
Always set to 1 for the ARM compiler, even when you specify the
--thumb option. |
__DATE__ |
date |
Always defined. |
__EDG__ |
- |
Always defined.
|
__EDG_IMPLICIT_USING_STD |
- |
In C++ mode when you specify the
--using_std option. |
__EDG_VERSION__ |
- |
Always set to an integer value that represents the version number of the Edison Design Group (EDG) front-end. For example, version 3.8 is represented as
308 .NoteThe version number of the EDG front-end does not necessarily match the version number of the ARM compiler toolchain. |
__EXCEPTIONS |
1 |
In C++ mode when you specify the
--exceptions option. |
__FEATURE_SIGNED_CHAR |
- |
When you specify the
--signed_chars option (used by CHAR_MIN and CHAR_MAX ). |
__FILE__ |
name |
Always defined as a string literal. |
__FP_FAST |
- |
When you specify the
--fpmode=fast option. |
__FP_FENV_EXCEPTIONS |
- |
When you specify the
--fpmode=ieee_full or --fpmode=ieee_fixed options. |
__FP_FENV_ROUNDING |
- |
When you specify the
--fpmode=ieee_full option. |
__FP_IEEE |
- |
When you specify the
--fpmode=ieee_full , --fpmode=ieee_fixed , or --fpmode=ieee_no_fenv options. |
__FP_INEXACT_EXCEPTION |
- |
When you specify the
--fpmode=ieee_full option. |
__IMPLICIT_INCLUDE |
- |
When you specify the
--implicit_include option. |
__LINE__ |
num |
Always set. It is the source line number of the line of code containing this macro. |
__MODULE__ |
mod |
Contains the filename part of the value of
__FILE__ . |
__MULTIFILE |
- | When you explicitly or implicitly use the --multifile option.a |
__OPTIMISE_LEVEL |
num |
Always set to 2 by default, unless you change the optimization level using the
-O option.a |
__OPTIMISE_SPACE |
- |
When you specify the
-Ospace option. |
__OPTIMISE_TIME |
- |
When you specify the
-Otime option. |
__OPTIMIZE__ |
- |
When
-O1 , -O2 , or -O3 is specified in GNU mode. |
__OPTIMIZE_SIZE__ |
- |
When
-Ospace is specified in GNU mode. |
__PLACEMENT_DELETE |
- | In C++ mode to specify that placement delete (that is, an operator delete corresponding to a placement operator new , to be called if the constructor throws an exception) is enabled. This is only relevant when using exceptions. |
__RTTI |
- | In C++ mode when RTTI is enabled. |
__sizeof_int |
4 |
For
sizeof(int) , but available in preprocessor expressions. |
__sizeof_long |
4 |
For
sizeof(long) , but available in preprocessor expressions. |
__sizeof_ptr |
4 |
For
sizeof(void *) , but available in preprocessor expressions. |
__SOFTFP__ |
- |
If compiling to use the software floating-point calling standard and library. Set when you specify the
--fpu=softvfp option for ARM or Thumb, or when you specify --fpu=softvfp+vfpv2 for Thumb. |
__STDC__ |
- | In all compiler modes. |
__STDC_VERSION__ |
- | Standard version information. |
__STRICT_ANSI__ |
- |
When you specify the
--strict option. |
__SUPPORT_SNAN__ |
- | Support for signalling NaNs when you specify --fpmode=ieee_fixed or --fpmode=ieee_full . |
__TARGET_ARCH_ARM |
num |
The number of the ARM base architecture of the target processor irrespective of whether the compiler is compiling for ARM or Thumb. For possible values of __TARGET_ARCH_ARM in relation to the ARM architecture versions, see the table below. |
__TARGET_ARCH_THUMB |
num |
The number of the Thumb base architecture of the target processor irrespective of whether the compiler is compiling for ARM or Thumb. The value is defined as zero if the target does not support Thumb. For possible values of
__TARGET_ARCH_THUMB in relation to the ARM architecture versions, see the table below. |
__TARGET_ARCH_ |
- |
represents the target architecture and its value depends on the target architecture. For example, if you specify the compiler options --cpu=4T or --cpu=ARM7TDMI then __TARGET_ARCH_4T is defined. |
__TARGET_CPU_ |
- |
represents the target processor. The value of is derived from the --cpu compiler option, or the default if none is specified. For example, if you specify the compiler option --cpu=ARM7TM then __TARGET_CPU_ARM7TM is defined and no other symbol starting with __TARGET_CPU_ is defined.If you specify the target architecture, then
__TARGET_CPU_generic is defined.If the processor name specified with
--cpu is in lowercase, it is converted to uppercase. For example, --cpu=Cortex-R4 results in __TARGET_CPU_CORTEX_R4 being defined (rather than __TARGET_CPU_Cortex_R4 ).If the processor name contains hyphen (-) characters, these are mapped to an underscore (
_ ). For example, --cpu=ARM1136JF-S is mapped to __TARGET_CPU_ARM1136JF_S . |
__TARGET_FEATURE_DOUBLEWORD |
- |
ARMv5T and above.
|
__TARGET_FEATURE_DSPMUL |
- | If the DSP-enhanced multiplier is available, for example ARMv5TE. |
__TARGET_FEATURE_MULTIPLY |
- |
If the target architecture supports the long multiply instructions
MULL and MULAL . |
__TARGET_FEATURE_DIVIDE |
- |
If the target architecture supports the hardware divide instruction (that is, ARMv7-M or ARMv7-R).
|
__TARGET_FEATURE_THUMB |
- | If the target architecture supports Thumb, ARMv4T or later. |
__TARGET_FPU_ |
- |
One of the following is set to indicate the FPU usage:
In addition, if compiling with one of the following
--fpu options, the corresponding target name is set:
|
__TARGET_PROFILE_R |
When you specify the --cpu=7-R option. |
|
__TARGET_PROFILE_M |
When you specify any of the following options:
|
|
__thumb __ |
- |
When the compiler is in Thumb state. That is, you have either specified the
--thumb option on the command-line or #pragma thumb in your source code.Note
|
__TIME__ |
time |
Always defined.
|
_WCHAR_T |
- |
In C++ mode, to specify that
wchar_t is a keyword. |
__TARGET_ARCH_THUMB
, and how these values relate to versions of the ARM architecture.9.150 Predefined macros的更多相关文章
- Cross Platform Note: STD C++ Preprocessor directives & pre-defined macros
ref: http://www.cplusplus.com/doc/tutorial/preprocessor/ concolusion: directives: #define #undef #in ...
- Windows Platform Predefined Macros
https://msdn.microsoft.com/en-us/library/b0084kay.aspx
- [原]__FILE__宏
在vs中__FILE__宏代表了当前文件,如果有/FC那么__FILE__代表了当前文件的全路径!否则只表示当前文件名 参考 https://msdn.microsoft.com/en-us/li ...
- C++预处理详解
本文在参考ISO/IEC 14882:2003和cppreference.com的C++ Preprocessor的基础上,对C++预处理做一个全面的总结讲解.如果没有特殊说明,所列内容均依据C++9 ...
- VS2010 C++环境下DLL和LIB文件目录及名称修改
VS2010 C++环境下DLL和LIB文件目录及名称修改 转自:http://blog.csdn.net/archielau/article/details/8507581 DLL工程,Debug版 ...
- gcc 编译器参数
一.GCC编译过程 参考:http://hi.baidu.com/zengzhaonong/item/c00e079f500adccab625314f------------------------- ...
- C++ 中常见预定义宏的使用
http://blog.csdn.net/hgl868/article/details/7058906 替代字符串: #define DOWNLOAD_IMAGE_LOG /var/log/png.l ...
- C++ 中宏的使用 --来自:http://blog.csdn.net/hgl868/article/details/7058906
宏在代码中的使用实例: g_RunLog2("Middleware client for Linux, build:%s %s", __DATE__, __TIME__); 下面详 ...
- [C] zintrin.h : 智能引入intrinsic函数。支持VC、GCC,兼容Windows、Linux、Mac OS X
博客来源:http://blog.csdn.net/zyl910/article/details/8100744 现在很多编译器支持intrinsic函数,这给编写SSE等SIMD代码带来了方便.但是 ...
- __LINE__ __DATE__ __FILE__ __TIME__ 等宏定义解释
Names the predefined ANSI C and Microsoft C++ implementation macros. The compiler recognizes predefi ...
随机推荐
- Pytorch复制现有环境
一,在本机上,打开anaconda Prompt直接使用 conda create -n 新环境名 --clone 旧环境名
- float与byte[]互相转换
今天想利用socket发送数据,可是float类型该怎么发送呢?我的想法是先转换成byte[]型,接收之后再转换回来. float类型是4个字节,而byte是1个字节,所以需要转换成为byte[]的类 ...
- yolov1-yolov5 网络结构&正负样本筛选&损失计算
学习yolo系列,最重要的,最核心的就是网络模型.正负样本匹配.损失函数等三个方面.本篇汇总了yolov1-yolov5等5个版本的相关知识点,主要看点是在yolo框架搭建.初学者可以通过相关篇章搭建 ...
- OpenLiveWriter的代码高亮插件
可参考如下方法: https://www.cnblogs.com/mq0036/p/12101912.html 0. 最新插件下载地址:Memento.OLW_V1.0.0.5.7z 1. 找到Ope ...
- Android 官方AB Update说明
Android 官方AB Update说明 A/B 系统更新,也称为无缝更新,用于确保可运行的启动系统在无线 (OTA) 更新期间能够保留在磁盘上.这样可以降低更新之后设备无法启动的可能性,也就是说, ...
- STM32 CubeMX 学习:000-搭建开发环境
背景 了解了 STM32 标准库以后,为了紧跟发展的潮流,我们以 CubeMx为基础 开始进行 Hal(Hardware Abstract Layer, 硬件抽象层)库的学习. CubeMx 是一个 ...
- 核对不同文件夹所含内容的差异并提取缺失内容:Python代码
本文介绍基于Python语言,以一个大文件夹作为标准,对另一个大文件夹所包含的子文件夹或文件加以查漏补缺,并将查漏补缺的结果输出的方法. 首先,来明确一下本文所需实现的具体需求.现有一个大文件 ...
- AT_abc318_g 题解
因为是图上路径是否经过某个点的问题,所以考虑建出圆方树,然后根据圆方树的性质,\(a\) 到 \(c\) 存在经过 \(b\) 的路径等价于 \(a,c\) 在圆方树上的路径经过 \(b\) 或者 \ ...
- debian12 安装ch343驱动
前言 最近心血来潮,装了一台debian12玩,安装完毕arduino后发现没有ch343驱动,倒是在 ls /lib/modules/6.1.0-13-amd64/kernel/drivers/us ...
- HGAME2023 week1-week2
确实是高质量比赛,学到了很多知识.认识到了很多的不足. 任重而道远啊... hgame_week1 web Classic Childhood Game F12检查源码,打开Events.js 发现 ...