Skip to content
Snippets Groups Projects
Commit 8dc72f3c authored by Moritz Angermann's avatar Moritz Angermann Committed by Ben Gamari
Browse files

Cleanup PosixSource.h

When trying to build arm64-apple-iso, the build fell over `strdup`, as
the arm64-apple-ios build did not fall into `darwin_HOST_OS`, and would
need `ios_HOST_OS`.

This diff tries to clean up PosixSource.h, instead of layering another
define on top.

As we use `strnlen` in sources that include PosixSource.h, and `strnlen`
is defined in POSIX.1-2008, the `_POSIX_C_SOURCE` and `_XOPEN_SOURCE`
are increased accordingly.

Furthermore the `_DARWIN_C_SOURCE` (required for `u_char`, etc. used in
sysctl.h) define is moved into `OSThreads.h` alongside a similar ifdef
for freebsd.

Test Plan: Build on all supported platforms.

Reviewers: austin, simonmar, erikd, kgardas, bgamari

Reviewed By: simonmar, erikd, kgardas, bgamari

Subscribers: Phyx, hvr, thomie

Differential Revision: https://phabricator.haskell.org/D2579

GHC Trac Issues: #12624
parent bcd34451
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment