--- wangle/acceptor/TransportInfo.h.orig	2022-08-15 00:36:09.000000000 +0700
+++ wangle/acceptor/TransportInfo.h	2022-08-15 00:29:03.000000000 +0700
@@ -114,11 +114,11 @@
    */
   int32_t maxPacingRate{-1};
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
   typedef tcp_connection_info tcp_info;
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
   /*
    * TCP information as fetched from getsockopt(2)
    */
@@ -352,7 +352,7 @@
    */
   static int64_t readRTT(const folly::AsyncSocket* sock);
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
   /*
    * perform the getsockopt(2) syscall to fetch TCP info for a given socket
    */

--- wangle/acceptor/TransportInfo.cpp.orig	2022-08-08 08:24:55.000000000 +0700
+++ wangle/acceptor/TransportInfo.cpp	2022-08-15 00:28:35.000000000 +0700
@@ -27,12 +27,12 @@
 namespace wangle {
 
 bool TransportInfo::initWithSocket(const folly::AsyncSocket* sock) {
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
   if (!TransportInfo::readTcpInfo(&tcpinfo, sock)) {
     tcpinfoErrno = errno;
     return false;
   }
-#ifdef __APPLE__
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
   rtt = microseconds(tcpinfo.tcpi_srtt * 1000);
   rtt_var = tcpinfo.tcpi_rttvar * 1000;
   rto = tcpinfo.tcpi_rto * 1000;
@@ -127,7 +127,7 @@
 #endif // defined(__linux__) || defined(__FreeBSD__)
 
 int64_t TransportInfo::readRTT(const folly::AsyncSocket* sock) {
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
   tcp_info tcpinfo;
   if (!TransportInfo::readTcpInfo(&tcpinfo, sock)) {
     return -1;
@@ -135,7 +135,7 @@
 #endif
 #if defined(__linux__) || defined(__FreeBSD__)
   return tcpinfo.tcpi_rtt;
-#elif defined(__APPLE__)
+#elif (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
   return tcpinfo.tcpi_srtt;
 #else
   (sock); // unused
@@ -143,11 +143,11 @@
 #endif
 }
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003
 #define TCP_INFO TCP_CONNECTION_INFO
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED > 101003)
 bool TransportInfo::readTcpInfo(
     tcp_info* tcpinfo,
     const folly::AsyncSocket* sock) {
