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
This commit is contained in:
parent
b271eff4c6
commit
3e13d4f9c4
@ -36,6 +36,17 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
# include <sys/endian.h>
|
||||||
|
# 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)
|
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||||
# include <endian.h>
|
# include <endian.h>
|
||||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user