diff --git a/common/common.cpp b/common/common.cpp index 8661e164a..7f0b739d4 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -36,6 +36,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 dba7be33b..d2be1b6ae 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 fdb430a43..2c9450730 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -2376,6 +2376,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 2ccb4b472..1d79ceb8d 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 944d90af3..41d8a1e6e 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))