This commit is contained in:
Giovanni Petrantoni 2025-02-10 19:41:59 +08:00 committed by GitHub
commit d2f376a0f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 34 additions and 0 deletions

View file

@ -36,6 +36,13 @@
#include <vector>
#if defined(__APPLE__) && defined(__MACH__)
#include <TargetConditionals.h>
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
// VisionOS lacks some legacy types definitions
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
#endif
#include <sys/types.h>
#include <sys/sysctl.h>
#endif

View file

@ -23,6 +23,13 @@
#include <vector>
#ifdef __APPLE__
#include <TargetConditionals.h>
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
// VisionOS lacks some legacy types definitions
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
#endif
#include <sys/types.h>
#include <sys/sysctl.h>
#endif

View file

@ -2376,6 +2376,13 @@ bool ggml_is_numa(void) {
#if defined(__linux__) && defined(__aarch64__)
#include <sys/auxv.h>
#elif defined(__APPLE__)
#include <TargetConditionals.h>
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
// VisionOS lacks some legacy types definitions
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
#endif
#include <sys/sysctl.h>
#endif

View file

@ -15,6 +15,13 @@
#endif
#if defined(__APPLE__)
#include <TargetConditionals.h>
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
// VisionOS lacks some legacy types definitions
typedef unsigned int u_int;
typedef unsigned char u_char;
typedef unsigned short u_short;
#endif
#include <sys/types.h>
#include <sys/sysctl.h>
#endif

View file

@ -8,6 +8,12 @@
#import <Metal/Metal.h>
#include <TargetConditionals.h>
#if defined(TARGET_OS_VISION) && TARGET_OS_VISION
// VisionOS lacks some legacy types definitions, stdint.h did not help either
typedef unsigned int uint;
#endif
#undef MIN
#undef MAX
#define MIN(a, b) ((a) < (b) ? (a) : (b))