From b2f7e0da082611e2fcea970f02b82fca80976ad6 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 30 Jul 2024 16:23:01 +0800 Subject: [PATCH] Fix build on macOS 10.15 and earlier Closes: https://github.com/aws/s2n-tls/issues/4673 --- tls/s2n_ktls_io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git tls/s2n_ktls_io.c tls/s2n_ktls_io.c index ad1d984c6..5ef776cf5 100644 --- tls/s2n_ktls_io.c +++ tls/s2n_ktls_io.c @@ -45,6 +45,16 @@ #define S2N_MAX_STACK_IOVECS 16 #define S2N_MAX_STACK_IOVECS_MEM (S2N_MAX_STACK_IOVECS * sizeof(struct iovec)) +#ifdef __APPLE__ +#include +#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000 +#ifdef __DARWIN_ALIGN32 +#undef __DARWIN_ALIGN32 +#define __DARWIN_ALIGN32(p) ((__darwin_size_t)((__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32) +#endif +#endif +#endif + /* Used to override sendmsg and recvmsg for testing. */ static ssize_t s2n_ktls_default_sendmsg(void *io_context, const struct msghdr *msg); static ssize_t s2n_ktls_default_recvmsg(void *io_context, struct msghdr *msg);