[waffle] [PATCH 3/3] Define _XOPEN_SOURCE on non-Linux platforms too
josh at joshtriplett.org
Tue Nov 27 17:50:37 PST 2012
On Tue, Nov 27, 2012 at 11:02:55AM -0800, Chad Versace wrote:
> On 11/27/2012 10:43 AM, Josh Triplett wrote:
> > Non-Linux platforms also respect _XOPEN_SOURCE, and require it for some
> > functions, such as strdup. Define it unconditionally, rather than only
> > when defined(__linux__).
> > Signed-off-by: Josh Triplett <josh at joshtriplett.org>
> > ---
> > src/waffle/core/wcore_error_unittest.c | 4 +---
> > tests/waffle_test/priv/wt_runner.c | 4 +---
> > 2 files changed, 2 insertions(+), 6 deletions(-)
> > -#ifdef __linux__
> > -# define _XOPEN_SOURCE 500 // for strdup()
> > -#endif
> > +#define _XOPEN_SOURCE 500 // for strdup()
> I vaguely recall that this macro definition caused a build failure on OSX.
> Later this week, I need to pull the MacBook out of storage to test this patch.
> I'm postponing commiting it until I've verified that it doesn't break the
> Mac build or I discover how to work around the build breakage on Mac.
If this does turn out to break things on OS X, and you don't have some
other way to fix that breakage, I can rework this patch to use an ifndef
for that platform rather than an ifdef for __linux__
- Josh Triplett
More information about the waffle