Skip to content

Commit

Permalink
folly | Bypass checking for system preadv and pwritev on iOS Simulato…
Browse files Browse the repository at this point in the history
…r 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
  • Loading branch information
mattjgalloway authored and facebook-github-bot committed Jul 16, 2020
1 parent 104d728 commit 818b7ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions folly/portability/SysUio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, *)) {
Expand All @@ -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, *)) {
Expand Down

0 comments on commit 818b7ab

Please sign in to comment.