From 100617d449c83cb037e2c7b4804fd19c919d8f15 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 2 Jun 2023 09:50:48 -0700 Subject: [PATCH] glfw: add macOS 13 SDK support Signed-off-by: Stephen Gutekanst --- src/sources_all.c | 3 +++ src/sources_macos.c | 3 +++ src/sources_macos.m | 3 +++ system_sdk.zig | 20 +++++++++++++++++--- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/sources_all.c b/src/sources_all.c index fad5a98eb..11f10dca2 100644 --- a/src/sources_all.c +++ b/src/sources_all.c @@ -1,3 +1,6 @@ +// MacOS: this must be defined for system-sdk-13.3 and older. +#define __kernel_ptr_semantics + // General sources #include "monitor.c" #include "init.c" diff --git a/src/sources_macos.c b/src/sources_macos.c index 273abc4c3..4f452efea 100644 --- a/src/sources_macos.c +++ b/src/sources_macos.c @@ -1,3 +1,6 @@ +// MacOS: this must be defined for system-sdk-13.3 and older. +#define __kernel_ptr_semantics + // MacOS-specific sources #include "cocoa_time.c" #include "posix_thread.c" diff --git a/src/sources_macos.m b/src/sources_macos.m index 6cb0699d3..b2187fda1 100644 --- a/src/sources_macos.m +++ b/src/sources_macos.m @@ -1,3 +1,6 @@ +// MacOS: this must be defined for system-sdk-13.3 and older. +#define __kernel_ptr_semantics + // MacOS-specific sources #include "cocoa_joystick.m" #include "cocoa_init.m" diff --git a/system_sdk.zig b/system_sdk.zig index 7d364715b..c839c3b13 100644 --- a/system_sdk.zig +++ b/system_sdk.zig @@ -8,8 +8,9 @@ //! * Windows: https://github.com/hexops/sdk-windows-x86_64 (~7MB, updated DirectX headers for Zig/MinGW) //! * Linux: https://github.com/hexops/sdk-linux-x86_64 (~40MB, X11, Wayland, etc. development libraries) //! * MacOS (most frameworks you'd find in the XCode SDK): -//! * https://github.com/hexops/sdk-macos-11.3 (~160MB, default) -//! * https://github.com/hexops/sdk-macos-12.0 (~112MB, only if you specify a macOS 12 target triple.) +//! * https://github.com/hexops/sdk-macos-11.3 (~160MB) +//! * https://github.com/hexops/sdk-macos-12.0 (~112MB) +//! * https://github.com/hexops/sdk-macos-13.3 (~160MB) //! //! You may supply your own SDKs via the Options struct if needed, although the Mach versions above //! will generally work for most OpenGL/Vulkan applications. @@ -43,6 +44,19 @@ pub const Options = struct { }; sdk_list: []const Sdk = &.{ + .{ + .name = "sdk-macos-13.3", + .git_addr = "https://github.com/hexops/sdk-macos-13.3", + .git_revision = "1615cd09b3a42ae590e05e63251a0e9fbc47bab5", + .cpu_arch = &.{ .aarch64, .x86_64 }, + .os_tag = .macos, + .os_version = .{ + .semver = .{ + .min = .{ .major = 13, .minor = 0 }, + .max = .{ .major = 14, .minor = std.math.maxInt(u32) }, + }, + }, + }, .{ .name = "sdk-macos-12.0", .git_addr = "https://github.com/hexops/sdk-macos-12.0", @@ -52,7 +66,7 @@ pub const Options = struct { .os_version = .{ .semver = .{ .min = .{ .major = 12, .minor = 0 }, - .max = .{ .major = 13, .minor = std.math.maxInt(u32) }, + .max = .{ .major = 12, .minor = std.math.maxInt(u32) }, }, }, },