[v1.04] Improve error reporting in the case of unkown microarchitectures. As pointed out in #224 this was already solved, but this commit tries to be an improvement over the previous implementation

This commit is contained in:
Dr-Noob
2024-02-05 08:36:24 +00:00
parent b072e5c331
commit cbcce9c2ed
4 changed files with 45 additions and 8 deletions

View File

@@ -200,8 +200,7 @@ static char* isas_string[] = {
#define UARCH_START if (false) {}
#define CHECK_UARCH(arch, cpu, im_, p_, v_, r_, str, uarch, vendor) \
else if (im_ == im && p_ == p && (v_ == NA || v_ == v) && (r_ == NA || r_ == r)) fill_uarch(arch, cpu, str, uarch, vendor);
#define UARCH_END else { printErr("Unknown microarchitecture detected: IM=0x%X P=0x%X V=0x%X R=0x%X", im, p, v, r); \
fprintf(stderr, "Please see https://github.com/Dr-Noob/cpufetch#61-unknown-microarchitecture-error to know how to report this error\n"); \
#define UARCH_END else { printUnknownUarch("Unknown microarchitecture detected: M=0x%X EM=0x%X F=0x%X EF=0x%X S=0x%X", m, em, f, ef, s); \
fill_uarch(arch, cpu, "Unknown", UARCH_UNKNOWN, CPU_VENDOR_UNKNOWN); }
void fill_uarch(struct uarch* arch, struct cpuInfo* cpu, char* str, MICROARCH u, VENDOR vendor) {