forked from boostorg/predef
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:
1 parent
3ecdcb44df
commit
b28bad14ea
26 files changed
+161
-40
No files matched your search
@@ -11,6 +11,7 @@ http://www.boost.org/LICENSE_1_0.txt)
|
||||
#include <boost/predef/version_number.h>
|
||||
#include <boost/predef/make.h>
|
||||
#include <boost/predef/library/c/gnu.h>
|
||||
#include <boost/predef/os/macos.h>
|
||||
#include <boost/predef/os/bsd.h>
|
||||
|
||||
/*`
|
||||
@@ -48,17 +49,22 @@ information and acquired knowledge:
|
||||
#define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
|
||||
|
||||
/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER.
|
||||
* And some OSs provide some for of endian header also.
|
||||
*/
|
||||
#if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
|
||||
!BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
|
||||
# if BOOST_LIB_C_GNU
|
||||
# include <endian.h>
|
||||
# else
|
||||
# if BOOST_OS_BSD
|
||||
# if BOOST_OS_BSD_OPEN
|
||||
# include <machine/endian.h>
|
||||
# else
|
||||
# include <sys/endian.h>
|
||||
# if BOOST_OS_MACOS
|
||||
# include <machine/endian.h>
|
||||
# else
|
||||
# if BOOST_OS_BSD
|
||||
# if BOOST_OS_BSD_OPEN
|
||||
# include <machine/endian.h>
|
||||
# else
|
||||
# include <sys/endian.h>
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Reference in new issue
Block a user