mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.98][ARM] Fix compilation for ARM in macOS
This commit is contained in:
@@ -4,8 +4,11 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
#include <sys/auxv.h>
|
#include <sys/auxv.h>
|
||||||
#include <asm/hwcap.h>
|
#include <asm/hwcap.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../common/global.h"
|
#include "../common/global.h"
|
||||||
#include "udev.h"
|
#include "udev.h"
|
||||||
@@ -122,6 +125,7 @@ void init_cpu_info(struct cpuInfo* cpu) {
|
|||||||
cpu->next_cpu = NULL;
|
cpu->next_cpu = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
// We assume all cpus share the same hardware
|
// We assume all cpus share the same hardware
|
||||||
// capabilities but I'm not sure it is always
|
// capabilities but I'm not sure it is always
|
||||||
// true...
|
// true...
|
||||||
@@ -167,6 +171,18 @@ struct features* get_features_info() {
|
|||||||
|
|
||||||
return feat;
|
return feat;
|
||||||
}
|
}
|
||||||
|
#elif defined __APPLE__ || __MACH__
|
||||||
|
struct features* get_features_info() {
|
||||||
|
struct features* feat = malloc(sizeof(struct features));
|
||||||
|
|
||||||
|
bool *ptr = &(feat->AES);
|
||||||
|
for(uint32_t i = 0; i < sizeof(struct features)/sizeof(bool); i++, ptr++) {
|
||||||
|
*ptr = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return feat;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct cpuInfo* get_cpu_info() {
|
struct cpuInfo* get_cpu_info() {
|
||||||
struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo));
|
struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo));
|
||||||
|
|||||||
Reference in New Issue
Block a user