sl@0: // Copyright 2005 Caleb Epstein sl@0: // Copyright 2006 John Maddock sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompany- sl@0: // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: /* sl@0: * Copyright (c) 1997 sl@0: * Silicon Graphics Computer Systems, Inc. sl@0: * sl@0: * Permission to use, copy, modify, distribute and sell this software sl@0: * and its documentation for any purpose is hereby granted without fee, sl@0: * provided that the above copyright notice appear in all copies and sl@0: * that both that copyright notice and this permission notice appear sl@0: * in supporting documentation. Silicon Graphics makes no sl@0: * representations about the suitability of this software for any sl@0: * purpose. It is provided "as is" without express or implied warranty. sl@0: */ sl@0: sl@0: /* sl@0: * Copyright notice reproduced from , from sl@0: * which this code was originally taken. sl@0: * sl@0: * Modified by Caleb Epstein to use with GNU libc and to sl@0: * defined the BOOST_ENDIAN macro. sl@0: */ sl@0: sl@0: #ifndef BOOST_DETAIL_ENDIAN_HPP sl@0: #define BOOST_DETAIL_ENDIAN_HPP sl@0: sl@0: // GNU libc offers the helpful header which defines sl@0: // __BYTE_ORDER sl@0: sl@0: #if defined (__GLIBC__) sl@0: # include sl@0: # if (__BYTE_ORDER == __LITTLE_ENDIAN) sl@0: # define BOOST_LITTLE_ENDIAN sl@0: # elif (__BYTE_ORDER == __BIG_ENDIAN) sl@0: # define BOOST_BIG_ENDIAN sl@0: # elif (__BYTE_ORDER == __PDP_ENDIAN) sl@0: # define BOOST_PDP_ENDIAN sl@0: # else sl@0: # error Unknown machine endianness detected. sl@0: # endif sl@0: # define BOOST_BYTE_ORDER __BYTE_ORDER sl@0: #elif defined(_BIG_ENDIAN) sl@0: # define BOOST_BIG_ENDIAN sl@0: # define BOOST_BYTE_ORDER 4321 sl@0: #elif defined(_LITTLE_ENDIAN) sl@0: # define BOOST_LITTLE_ENDIAN sl@0: # define BOOST_BYTE_ORDER 1234 sl@0: #elif defined(__sparc) || defined(__sparc__) \ sl@0: || defined(_POWER) || defined(__powerpc__) \ sl@0: || defined(__ppc__) || defined(__hpux) \ sl@0: || defined(_MIPSEB) || defined(_POWER) \ sl@0: || defined(__s390__) sl@0: # define BOOST_BIG_ENDIAN sl@0: # define BOOST_BYTE_ORDER 4321 sl@0: #elif defined(__i386__) || defined(__alpha__) \ sl@0: || defined(__ia64) || defined(__ia64__) \ sl@0: || defined(_M_IX86) || defined(_M_IA64) \ sl@0: || defined(_M_ALPHA) || defined(__amd64) \ sl@0: || defined(__amd64__) || defined(_M_AMD64) \ sl@0: || defined(__x86_64) || defined(__x86_64__) \ sl@0: || defined(_M_X64) sl@0: sl@0: # define BOOST_LITTLE_ENDIAN sl@0: # define BOOST_BYTE_ORDER 1234 sl@0: #else sl@0: # error The file boost/detail/endian.hpp needs to be set up for your CPU type. sl@0: #endif sl@0: sl@0: sl@0: #endif