File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -359,7 +359,20 @@ static inline uint64_t WDTGetSysCtl64BySpecifier(char* specifier) {
359359
360360### CPU Type
361361
362- 我们知道 iPhone 使用的处理器架构都是 ARM 的,而 ARM 又分为 ARMV7、ARMV7S 和 ARM64等。而想要获取设备具体的处理器架构则需要使用 `NXGetLocalArchInfo()` 函数。
362+ 我们知道 iPhone 使用的处理器架构都是 ARM 的,而 ARM 又分为 ARMV7、ARMV7S 和 ARM64等。而想要获取设备具体的处理器架构则需要使用 `NXGetLocalArchInfo()` 函数。这个函数的返回值是 `NXArchInfo` 结构体类型,如下:
363+
364+ ``` c
365+ typedef struct {
366+ const char *name;
367+ cpu_type_t cputype;
368+ cpu_subtype_t cpusubtype;
369+ enum NXByteOrder byteorder;
370+ const char *description;
371+ } NXArchInfo;
372+ ```
373+
374+ ` NXArchInfo ` 结构体成员变量中就包含我们需要的信息:` cputype ` 和 ` cputype ` ,这两个变量类型的定义在 ` mach/machine.h ` 头文件中给出,本质上都是 ` int ` 类型 ` typedef ` 得到的。
375+
363376
364377``` objective-c
365378+ (NSInteger )cpuType {
You can’t perform that action at this time.
0 commit comments