os/ossrv/ossrv_pub/boost_apis/boost/detail/endian.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/detail/endian.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,73 @@
     1.4 +// Copyright 2005 Caleb Epstein
     1.5 +// Copyright 2006 John Maddock
     1.6 +// Distributed under the Boost Software License, Version 1.0. (See accompany-
     1.7 +// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.8 +
     1.9 +/*
    1.10 + * Copyright (c) 1997
    1.11 + * Silicon Graphics Computer Systems, Inc.
    1.12 + *
    1.13 + * Permission to use, copy, modify, distribute and sell this software
    1.14 + * and its documentation for any purpose is hereby granted without fee,
    1.15 + * provided that the above copyright notice appear in all copies and
    1.16 + * that both that copyright notice and this permission notice appear
    1.17 + * in supporting documentation.  Silicon Graphics makes no
    1.18 + * representations about the suitability of this software for any
    1.19 + * purpose.  It is provided "as is" without express or implied warranty.
    1.20 + */
    1.21 +
    1.22 +/*
    1.23 + * Copyright notice reproduced from <boost/detail/limits.hpp>, from
    1.24 + * which this code was originally taken.
    1.25 + *
    1.26 + * Modified by Caleb Epstein to use <endian.h> with GNU libc and to
    1.27 + * defined the BOOST_ENDIAN macro.
    1.28 + */
    1.29 +
    1.30 +#ifndef BOOST_DETAIL_ENDIAN_HPP
    1.31 +#define BOOST_DETAIL_ENDIAN_HPP
    1.32 +
    1.33 +// GNU libc offers the helpful header <endian.h> which defines
    1.34 +// __BYTE_ORDER
    1.35 +
    1.36 +#if defined (__GLIBC__)
    1.37 +# include <endian.h>
    1.38 +# if (__BYTE_ORDER == __LITTLE_ENDIAN)
    1.39 +#  define BOOST_LITTLE_ENDIAN
    1.40 +# elif (__BYTE_ORDER == __BIG_ENDIAN)
    1.41 +#  define BOOST_BIG_ENDIAN
    1.42 +# elif (__BYTE_ORDER == __PDP_ENDIAN)
    1.43 +#  define BOOST_PDP_ENDIAN
    1.44 +# else
    1.45 +#  error Unknown machine endianness detected.
    1.46 +# endif
    1.47 +# define BOOST_BYTE_ORDER __BYTE_ORDER
    1.48 +#elif defined(_BIG_ENDIAN)
    1.49 +# define BOOST_BIG_ENDIAN
    1.50 +# define BOOST_BYTE_ORDER 4321
    1.51 +#elif defined(_LITTLE_ENDIAN)
    1.52 +# define BOOST_LITTLE_ENDIAN
    1.53 +# define BOOST_BYTE_ORDER 1234
    1.54 +#elif defined(__sparc) || defined(__sparc__) \
    1.55 +   || defined(_POWER) || defined(__powerpc__) \
    1.56 +   || defined(__ppc__) || defined(__hpux) \
    1.57 +   || defined(_MIPSEB) || defined(_POWER) \
    1.58 +   || defined(__s390__)
    1.59 +# define BOOST_BIG_ENDIAN
    1.60 +# define BOOST_BYTE_ORDER 4321
    1.61 +#elif defined(__i386__) || defined(__alpha__) \
    1.62 +   || defined(__ia64) || defined(__ia64__) \
    1.63 +   || defined(_M_IX86) || defined(_M_IA64) \
    1.64 +   || defined(_M_ALPHA) || defined(__amd64) \
    1.65 +   || defined(__amd64__) || defined(_M_AMD64) \
    1.66 +   || defined(__x86_64) || defined(__x86_64__) \
    1.67 +   || defined(_M_X64)
    1.68 +
    1.69 +# define BOOST_LITTLE_ENDIAN
    1.70 +# define BOOST_BYTE_ORDER 1234
    1.71 +#else
    1.72 +# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
    1.73 +#endif
    1.74 +
    1.75 +
    1.76 +#endif