diff --git a/common/common.cpp b/common/common.cpp index 20be92911..ce7ae61ad 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -30,6 +30,13 @@ #include #if defined(__APPLE__) && defined(__MACH__) +#include +#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 #include #endif diff --git a/ggml/src/ggml-backend.cpp b/ggml/src/ggml-backend.cpp index fdb4b986f..ce7d3dfa0 100644 --- a/ggml/src/ggml-backend.cpp +++ b/ggml/src/ggml-backend.cpp @@ -23,6 +23,13 @@ #include #ifdef __APPLE__ +#include +#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 #include #endif diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index b7fefb9dd..568e1eb02 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -2382,6 +2382,13 @@ bool ggml_is_numa(void) { #if defined(__linux__) && defined(__aarch64__) #include #elif defined(__APPLE__) +#include +#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 #endif diff --git a/ggml/src/ggml-cpu/ggml-cpu.cpp b/ggml/src/ggml-cpu/ggml-cpu.cpp index f11399cc6..a49c173db 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.cpp +++ b/ggml/src/ggml-cpu/ggml-cpu.cpp @@ -15,6 +15,13 @@ #endif #if defined(__APPLE__) +#include +#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 #include #endif diff --git a/ggml/src/ggml-metal/ggml-metal.m b/ggml/src/ggml-metal/ggml-metal.m index 28f590f92..ef03124ca 100644 --- a/ggml/src/ggml-metal/ggml-metal.m +++ b/ggml/src/ggml-metal/ggml-metal.m @@ -8,6 +8,12 @@ #import +#include +#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))