diff --git a/include/boost/predef/os/bsd.h b/include/boost/predef/os/bsd.h index be728d7..0adc435 100644 --- a/include/boost/predef/os/bsd.h +++ b/include/boost/predef/os/bsd.h @@ -8,6 +8,13 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_OS_BSD_H #define BOOST_PREDEF_OS_BSD_H +/* Special case: OSX will define BSD predefs if the sys/param.h + * header is included. We can guard against that, but only if we + * detect OSX first. Hence we will force include OSX detection + * before doing any BSD detection. + */ +#include + #include #include diff --git a/test/macos_endian.c b/test/macos_endian.c index 4397008..9a9b5a6 100644 --- a/test/macos_endian.c +++ b/test/macos_endian.c @@ -12,9 +12,10 @@ http://www.boost.org/LICENSE_1_0.txt) * tests that the sys/param.h include can be included before * endian detection and still have it work correctly. */ -#include -#if BOOST_OS_MACOS +#if defined(__APPLE__) # include +# include +# include # include #endif diff --git a/test/macos_vs_bsd.c b/test/macos_vs_bsd.c index 5d4af12..b22cb44 100644 --- a/test/macos_vs_bsd.c +++ b/test/macos_vs_bsd.c @@ -9,12 +9,11 @@ http://www.boost.org/LICENSE_1_0.txt) * OSX can masquerade as BSD when sys/param.h is previously included. * So we test that we only detect OSX in this combination. */ -#include - -#if BOOST_OS_MACOS +#if defined(__APPLE__) # include # include -# if BOOST_OS_BSD -# error "Both BOOST_OS_MACOS and BOOST_OS_BSD defined." +# include +# if !BOOST_OS_MACOS || BOOST_OS_BSD +# error "BOOST_OS_MACOS not detected and/or BOOST_OS_BSD mis-detected." # endif #endif