From b345eeaa4a5feab340b574553bd4ffb5a4451414 Mon Sep 17 00:00:00 2001 From: barracuda156 Date: Fri, 12 Jan 2024 07:09:31 +0800 Subject: [PATCH] Fix for __DARWIN_ALIGN32 on macOS < 11 --- folly/io/async/fdsock/AsyncFdSocket.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/folly/io/async/fdsock/AsyncFdSocket.h b/folly/io/async/fdsock/AsyncFdSocket.h index d3d84bb5873..8fbfbd9baad 100644 --- a/folly/io/async/fdsock/AsyncFdSocket.h +++ b/folly/io/async/fdsock/AsyncFdSocket.h @@ -19,6 +19,16 @@ #include #include +#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 + namespace folly { // Including `gtest/gtest_prod.h` would make gtest/gmock a hard dep