开发者

Can I printf g++'s architechture

I'd like to do something similar to this in g++:

printf("Architecture: %s", M_ARCH);

but I don't know how or if it's even pos开发者_开发百科sible?


No, there doesn't appear to be anything that easy.

Specific architectures are defined such as __amd64__ and __i386__, but you would have to write your own macro to check #ifdef __amd64__ etc to define your own M_ARCH.

(You can check all of the existing preprocessor definitions by using gcc -dM -E foo.c > defines.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜