From a6a1155a6b824fa5bc5706ec06f1e459c5f278fe Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 12 Jan 2024 17:06:27 +0800 Subject: [PATCH] AsyncFdSocket.h: fix for macOS < 11 Fixes: https://github.com/facebook/folly/issues/2099 --- 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