Jer*_*ner 5 c macos-carbon deprecated osx-mountain-lion
我有一个已经存在了一段时间(超过10年)的C ++代码库,并且可以正常运行,但是我注意到当我在OS / X 10.8.x(Mountain Lion)下对其进行编译时,编译器会发出关于以下内容的弃用警告:它调用的一些Carbon函数:
../system/SetupSystem.cpp:575:44: warning: 'UpTime' is deprecated: first
deprecated in OS X 10.8 [-Wdeprecated-declarations]
../system/SetupSystem.cpp:575:22: warning: 'AbsoluteToNanoseconds' is
deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
../system/SystemInfo.cpp:249:25: warning: 'MPProcessors' is deprecated: first deprecated in OS X 10.7 [-Wdeprecated-declarations]
Run Code Online (Sandbox Code Playgroud)
我想将此代码库升级到Apple认可的新工作方式(从而避免警告和将来(如果Apple最终删除这些功能时)的麻烦),但是我不知道新标准是什么。我浏览了developer.apple.com上的OS / X文档,但是缺少搜索技能或者缺少他们的文档,因为我发现这些功能几乎没有,也没有替代品。
我有一些具体问题:
我找到了上面列出的功能的可用替代品:
#include <mach/mach_host.h> mach_msg_type_number_t infoCount = HOST_BASIC_INFO_COUNT; host_info(gHostPort, HOST_BASIC_INFO, (host_info_t)&hostInfo, &infoCount); int numProcessors = hostInfo.avail_cpus;
| 归档时间: |
|
| 查看次数: |
2292 次 |
| 最近记录: |