forked from boostorg/predef
More stringent testing of OSX BSD like behavior. Fix BSD mis-detection
on OSX depending on include order.
This commit is contained in:
@@ -8,6 +8,13 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
#ifndef BOOST_PREDEF_OS_BSD_H
|
#ifndef BOOST_PREDEF_OS_BSD_H
|
||||||
#define 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 <boost/predef/os/macos.h>
|
||||||
|
|
||||||
#include <boost/predef/version_number.h>
|
#include <boost/predef/version_number.h>
|
||||||
#include <boost/predef/make.h>
|
#include <boost/predef/make.h>
|
||||||
|
|
||||||
|
@@ -12,9 +12,10 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
* tests that the sys/param.h include can be included before
|
* tests that the sys/param.h include can be included before
|
||||||
* endian detection and still have it work correctly.
|
* endian detection and still have it work correctly.
|
||||||
*/
|
*/
|
||||||
#include <boost/predef/os/macos.h>
|
|
||||||
|
|
||||||
#if BOOST_OS_MACOS
|
#if defined(__APPLE__)
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
|
# include <boost/predef/os/bsd.h>
|
||||||
|
# include <boost/predef/os/macos.h>
|
||||||
# include <boost/predef/other/endian.h>
|
# include <boost/predef/other/endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
@@ -9,12 +9,11 @@ http://www.boost.org/LICENSE_1_0.txt)
|
|||||||
* OSX can masquerade as BSD when sys/param.h is previously included.
|
* OSX can masquerade as BSD when sys/param.h is previously included.
|
||||||
* So we test that we only detect OSX in this combination.
|
* So we test that we only detect OSX in this combination.
|
||||||
*/
|
*/
|
||||||
#include <boost/predef/os/macos.h>
|
#if defined(__APPLE__)
|
||||||
|
|
||||||
#if BOOST_OS_MACOS
|
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# include <boost/predef/os/bsd.h>
|
# include <boost/predef/os/bsd.h>
|
||||||
# if BOOST_OS_BSD
|
# include <boost/predef/os/macos.h>
|
||||||
# error "Both BOOST_OS_MACOS and BOOST_OS_BSD defined."
|
# if !BOOST_OS_MACOS || BOOST_OS_BSD
|
||||||
|
# error "BOOST_OS_MACOS not detected and/or BOOST_OS_BSD mis-detected."
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user