From 1494bb89fc004ccfb1ac34d2d9f0de5a6800d9fe Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Thu, 25 Jun 2026 16:58:42 -0700 Subject: [PATCH] Change the io_uring existence macros to integer values `true` and `false` import differently with C23 than before, so the swift-side test `(__SWIFT_IORING_SUPPORTED != 0)` became dependent on the toolchain. Integer constants are more reliable for this. --- Sources/CSystem/include/io_uring.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/CSystem/include/io_uring.h b/Sources/CSystem/include/io_uring.h index 686bb77..3010bbc 100644 --- a/Sources/CSystem/include/io_uring.h +++ b/Sources/CSystem/include/io_uring.h @@ -81,7 +81,7 @@ #ifdef IORING_TIMEOUT_BOOTTIME // Kernel version >= 5.15, io_uring_sqe has file_index // and all current Swift operations are supported. -#define __SWIFT_IORING_SUPPORTED true +#define __SWIFT_IORING_SUPPORTED 1 typedef struct io_uring_sqe swift_io_uring_sqe; #else // io_uring_sqe is missing properties that IORequest expects. @@ -89,7 +89,7 @@ typedef struct io_uring_sqe swift_io_uring_sqe; // // Define a fallback struct to avoid build errors, but IORing // will throw ENOTSUP on initialization. -#define __SWIFT_IORING_SUPPORTED false +#define __SWIFT_IORING_SUPPORTED 0 typedef struct __SWIFT_IORING_SQE_FALLBACK_STRUCT swift_io_uring_sqe; #endif @@ -107,7 +107,7 @@ typedef struct __SWIFT_IORING_SQE_FALLBACK_STRUCT swift_io_uring_sqe; // Minimal fallback definitions when linux/io_uring.h is not available (e.g. static SDK) #include -#define __SWIFT_IORING_SUPPORTED false +#define __SWIFT_IORING_SUPPORTED 0 #define IORING_OFF_SQ_RING 0ULL #define IORING_OFF_CQ_RING 0x8000000ULL