Commit 818b7ab5 authored by Matt Galloway's avatar Matt Galloway Committed by Facebook GitHub Bot

folly | Bypass checking for system preadv and pwritev on iOS Simulator platform

Summary: Fix building folly sysuio portability when targeting the iOS simulator, because the current Xcode 12 SDK does not contain `preadv` and `pwritev` for the iOS simulator on Catalina, even though it declares it's there, so we get link errors.

Reviewed By: yfeldblum

Differential Revision: D22569172

fbshipit-source-id: 870b47063cb37a24364d1de292aba1f966edfb7c
parent 104d728c
......@@ -68,6 +68,7 @@ ssize_t preadv(int fd, const iovec* iov, int count, off_t offset) {
using sig = ssize_t(int, const iovec*, int, off_t);
static auto the_preadv = []() -> sig* {
#if defined(__APPLE__) && FOLLY_HAS_BUILTIN(__builtin_available) && \
!TARGET_OS_SIMULATOR && \
(__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600 || \
__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000)
if (__builtin_available(iOS 14.0, macOS 11.0, *)) {
......@@ -86,6 +87,7 @@ ssize_t pwritev(int fd, const iovec* iov, int count, off_t offset) {
using sig = ssize_t(int, const iovec*, int, off_t);
static auto the_pwritev = []() -> sig* {
#if defined(__APPLE__) && FOLLY_HAS_BUILTIN(__builtin_available) && \
!TARGET_OS_SIMULATOR && \
(__MAC_OS_X_VERSION_MAX_ALLOWED >= 101600 || \
__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000)
if (__builtin_available(iOS 14.0, macOS 11.0, *)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment