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.

[SVN r86167]
This commit is contained in:
Rene Rivera committed 2013-10-05 21:50:45 +00:00
1 parent 8931511834
commit d002626ef7
26 files changed
+161 -40

No files matched your search

+11 -5
View File
@@ -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