Address endian compile errors for OSX in the cases where sys/param.h was

include ahead of the predef headers. The solution was to: use the OSX
machine/endian.h header, and only allow a single OS to be detected at
once. Test cases added for both conditions on OSX.
This commit is contained in:
Rene Rivera committed 2013-10-05 16:41:55 -05:00
1 parent 3ecdcb44df
commit b28bad14ea
26 files changed
+161 -40

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
/*
Copyright Redshift Software Inc. 2013
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
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 <boost/predef/os/macos.h>
#if BOOST_OS_MACOS
# include <sys/param.h>
# include <boost/predef/os/bsd.h>
# if BOOST_OS_BSD
# error "Both BOOST_OS_MACOS and BOOST_OS_BSD defined."
# endif
#endif