const char *ByteOrder(enum NXByteOrder BO)
{
    switch (BO) {
        case NX_LittleEndian: return ("Little-Endian");
        case NX_BigEndian: return ("Big-Endian");
        case NX_UnknownByteOrder: return "Unknow";
        default: return ("!?!");
    }
}

void archTest()
{
    const NXArchInfo *local = NXGetLocalArchInfo();
    const NXArchInfo *known = NXGetAllArchInfos();
    
    while (known && known->description) {
        printf("known: %s\t%x/%x\t%s\n", known->description,
                                        known->cputype,
                                        known->cpusubtype,
               ByteOrder(known->byteorder));
        known++;
    }
    
    if (local) {
        printf("Local - %s\t%x/%x\t%s\n", local->description,
                                        local->cputype,
                                        local->cpusubtype,
               ByteOrder(local->byteorder));
    }
}


你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。