Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ggml/src/ggml-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ggml/src/ggml-cpu/ggml-cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions ggml/src/ggml-cpu/ggml-cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions ggml/src/ggml-metal/ggml-metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down