简体   繁体   English

armhf c++ 的预处理器变量

[英]Preprocessor variable for armhf c++


Such a question: how can I determine that the code is running on a computer that has an armhf processor? 这样的问题:如何确定代码在具有 armhf 处理器的计算机上运行?
I know that for ARM64 there is a preprocessor variable __aarch64__ and I can do something like this: 我知道对于 ARM64 有一个预处理器变量 __aarch64__ ,我可以这样做:
 #if defined(__aarch64___)... #endif

Is there the same variable for armhf? armhf 是否有相同的变量?

A command similar to this one lists all the predefined macros of your compiler (of course, you have to replace g++ by your actual compiler for the specific target, and add the specific options for this target).与此类似的命令列出了编译器的所有预定义(当然,您必须将g++替换为特定目标的实际编译器,并为此目标添加特定选项)。

echo | g++ -dM -E - | sort

You will certainly detect some explicit enough names you can test with #if defined .您肯定会检测到一些足够明确的名称,您可以使用#if defined进行测试。 And of course, once you have found the interesting names, you have to check the documentation in order to ensure they actually have the meaning you suppose.当然,一旦你找到了有趣的名字,你必须检查文档以确保它们确实具有你想象的含义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM