Skip to content

Commit

Permalink
wrap: include xlocale.h header on macOS
Browse files Browse the repository at this point in the history
Compiling the wrap filter fails on macOS because the locale.h header
does not include declarations for locale_t, freelocale, or newlocale.
Instead, these are included in the xlocale.h header.

We use a conditional include because glibc no longer ships the xlocale.h
header in its distribution.

Signed-off-by: Gregory Anders <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
gpanders authored and rjarry committed May 29, 2024
1 parent 9e93d9e commit 5908fd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions filters/wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#include <wchar.h>
#include <wctype.h>

#ifdef __APPLE__
#include <xlocale.h>
#endif

static void usage(void)
{
puts("usage: wrap [-h] [-w INT] [-r] [-l INT] [-f FILE]");
Expand Down

0 comments on commit 5908fd0

Please sign in to comment.