From 14ebd6f7ceb8f4aec4be328cf9ba5c6721575cd6 Mon Sep 17 00:00:00 2001 From: Ivan Semkin Date: Mon, 23 Sep 2024 13:21:00 +0300 Subject: [PATCH 1/2] Revert "Resolve build problems with Xcode 16 beta 1 due to missing typedefs in SDKs" This reverts commit 690de7ddd4e024390f092cec284aae0684171525. --- Sources/WireGuardKitC/WireGuardKitC.h | 34 ++++++--------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/Sources/WireGuardKitC/WireGuardKitC.h b/Sources/WireGuardKitC/WireGuardKitC.h index 8c9bb2e..36218b9 100644 --- a/Sources/WireGuardKitC/WireGuardKitC.h +++ b/Sources/WireGuardKitC/WireGuardKitC.h @@ -4,37 +4,17 @@ #include "key.h" #include "x25519.h" - -// -// Note from CJ 2024-06-13 -// Xcode 16 beta 1 broke compatibility by removing the type definitions for u_int32_t -// which are old lingering references to the BSD origins of xnu -// https://opensource.apple.com/source/xnu/xnu-344/bsd/sys/kern_control.h.auto.html -// There are two ways to resolve this -// -// this way -//typedef unsigned int u_int32_t; -//typedef unsigned char u_char; -//typedef unsigned short u_int16_t; -// -// or -// typedef uint32_t u_int32_t; -//typedef uint8_t u_char; -//typedef uint16_t u_int16_t; -// -// I opted for skipping right past all of the typedefs and using the solution below - /* From */ #define CTLIOCGINFO 0xc0644e03UL struct ctl_info { - unsigned int ctl_id; + u_int32_t ctl_id; char ctl_name[96]; }; struct sockaddr_ctl { - unsigned char sc_len; - unsigned char sc_family; - unsigned short ss_sysaddr; - unsigned int sc_id; - unsigned int sc_unit; - unsigned int sc_reserved[5]; + u_char sc_len; + u_char sc_family; + u_int16_t ss_sysaddr; + u_int32_t sc_id; + u_int32_t sc_unit; + u_int32_t sc_reserved[5]; }; From d606ca895dfc051d9979d82005eab91da7c287f4 Mon Sep 17 00:00:00 2001 From: Ivan Semkin Date: Mon, 23 Sep 2024 13:21:59 +0300 Subject: [PATCH 2/2] Resolve build problems with Xcode 16 --- Sources/WireGuardKitC/WireGuardKitC.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/WireGuardKitC/WireGuardKitC.h b/Sources/WireGuardKitC/WireGuardKitC.h index 36218b9..c643b66 100644 --- a/Sources/WireGuardKitC/WireGuardKitC.h +++ b/Sources/WireGuardKitC/WireGuardKitC.h @@ -1,6 +1,8 @@ // SPDX-License-Identifier: MIT // Copyright © 2018-2021 WireGuard LLC. All Rights Reserved. +#include + #include "key.h" #include "x25519.h"