Windows 系统: 可以通过环境变量 PROCESSOR_ARCHITECTURE 获取 CPU 架构类型。
2. sysutil.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#pragma once
#include<cstdint> #include<string>
namespace cutl { /** * @brief Get the architecture of the cpu processor(or operating system). * * @return std::string the architecture. */ std::string architecture(); } // namespace cutl