From 3e13d4f9c455ba600ffbe6f1a8a9e8029a8432a8 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Wed, 11 Aug 2010 16:27:20 +0000 Subject: [PATCH] Include sys/endian.h on FreeBSD and use that to detect the byte order. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@110824 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/__config | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/__config b/include/__config index 42797365..c3cf8c7b 100644 --- a/include/__config +++ b/include/__config @@ -36,6 +36,17 @@ #endif #endif +#ifdef __FreeBSD__ +# include +# if _BYTE_ORDER == _LITTLE_ENDIAN +# define _LIBCPP_LITTLE_ENDIAN 1 +# define _LIBCPP_BIG_ENDIAN 0 +# else +# define _LIBCPP_LITTLE_ENDIAN 0 +# define _LIBCPP_BIG_ENDIAN 1 +# endif +#endif + #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) # include # if __BYTE_ORDER == __LITTLE_ENDIAN