__get_cpuid 的便携性如何? [英] How portable is __get_cpuid?

查看:82
本文介绍了__get_cpuid 的便携性如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 __get_cpuid() 获取有关运行我的程序的 x86x86_64 处理器的信息.在 Linux 和 Mac OS 上使用 GCC,它似乎可以在不包含任何头文件的情况下编译和运行,但它的可移植性如何?它可以与其他编译器一起使用吗?我应该为此包含一个标题吗?

I'm using __get_cpuid() to get info on the x86 and x86_64 processors my programs run on. With GCC on Linux and Mac OS, it seems to compile and run OK without include any header, but how portable is that? Would it work with other compilers? Should I include a header for that?

推荐答案

它有两个前导下划线.任何前导下划线都表明该变量或函数不可移植.

It has two leading underscores. Any leading underscore at all is a big hint that the variable or function is not portable.

这篇关于__get_cpuid 的便携性如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆