Only define _XOPEN_SOURCE on Linux

This breaks the build on recent versions of macOS. Defining
_XOPEN_SOURCE is not necessary to access pthread_rwlock_t. Worse,
defining it makes __DARWIN_C_LEVEL equal to _POSIX_C_SOURCE, which
disables access to functions like timespec_get and aligned_alloc
on macOS 10.15 and newer, which are now used by libc++.

Change-Id: I5098dae8288bdb4a4ca912b35110240f35fbf69f
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/boringssl/+/419139
Reviewed-by: Roland McGrath <mcgrathr@google.com>
Commit-Queue: Petr Hosek <phosek@google.com>
1 file changed