Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:47

0001 //  boost/endian/endian.hpp  -----------------------------------------------------------//
0002 
0003 //  Copyright Beman Dawes 2015
0004 
0005 //  Distributed under the Boost Software License, Version 1.0.
0006 //  See http://www.boost.org/LICENSE_1_0.txt
0007 
0008 //  See library home page at http://www.boost.org/libs/endian
0009 
0010 #ifndef BOOST_ENDIAN_ENDIAN_HPP
0011 #define BOOST_ENDIAN_ENDIAN_HPP
0012 
0013 #ifndef BOOST_ENDIAN_DEPRECATED_NAMES
0014 # error "<boost/endian/endian.hpp> is deprecated. Define BOOST_ENDIAN_DEPRECATED_NAMES to use."
0015 #endif
0016 
0017 #include <boost/config/header_deprecated.hpp>
0018 
0019 BOOST_HEADER_DEPRECATED( "<boost/endian/arithmetic.hpp>" )
0020 
0021 #include <boost/endian/arithmetic.hpp>
0022 #include <boost/config.hpp>
0023 
0024 namespace boost
0025 {
0026 namespace endian
0027 {
0028   typedef order endianness;
0029   typedef align alignment;
0030 
0031 # ifndef  BOOST_NO_CXX11_TEMPLATE_ALIASES
0032   template <order Order, class T, std::size_t n_bits,
0033     align Align = align::no>
0034   using endian = endian_arithmetic<Order, T, n_bits, Align>;
0035 # endif
0036 
0037   // unaligned big endian signed integer types
0038   typedef endian_arithmetic< order::big, int_least8_t, 8 >           big8_t;
0039   typedef endian_arithmetic< order::big, int_least16_t, 16 >         big16_t;
0040   typedef endian_arithmetic< order::big, int_least32_t, 24 >         big24_t;
0041   typedef endian_arithmetic< order::big, int_least32_t, 32 >         big32_t;
0042   typedef endian_arithmetic< order::big, int_least64_t, 40 >         big40_t;
0043   typedef endian_arithmetic< order::big, int_least64_t, 48 >         big48_t;
0044   typedef endian_arithmetic< order::big, int_least64_t, 56 >         big56_t;
0045   typedef endian_arithmetic< order::big, int_least64_t, 64 >         big64_t;
0046 
0047   // unaligned big endian_arithmetic unsigned integer types
0048   typedef endian_arithmetic< order::big, uint_least8_t, 8 >          ubig8_t;
0049   typedef endian_arithmetic< order::big, uint_least16_t, 16 >        ubig16_t;
0050   typedef endian_arithmetic< order::big, uint_least32_t, 24 >        ubig24_t;
0051   typedef endian_arithmetic< order::big, uint_least32_t, 32 >        ubig32_t;
0052   typedef endian_arithmetic< order::big, uint_least64_t, 40 >        ubig40_t;
0053   typedef endian_arithmetic< order::big, uint_least64_t, 48 >        ubig48_t;
0054   typedef endian_arithmetic< order::big, uint_least64_t, 56 >        ubig56_t;
0055   typedef endian_arithmetic< order::big, uint_least64_t, 64 >        ubig64_t;
0056 
0057   // unaligned little endian_arithmetic signed integer types
0058   typedef endian_arithmetic< order::little, int_least8_t, 8 >        little8_t;
0059   typedef endian_arithmetic< order::little, int_least16_t, 16 >      little16_t;
0060   typedef endian_arithmetic< order::little, int_least32_t, 24 >      little24_t;
0061   typedef endian_arithmetic< order::little, int_least32_t, 32 >      little32_t;
0062   typedef endian_arithmetic< order::little, int_least64_t, 40 >      little40_t;
0063   typedef endian_arithmetic< order::little, int_least64_t, 48 >      little48_t;
0064   typedef endian_arithmetic< order::little, int_least64_t, 56 >      little56_t;
0065   typedef endian_arithmetic< order::little, int_least64_t, 64 >      little64_t;
0066 
0067   // unaligned little endian_arithmetic unsigned integer types
0068   typedef endian_arithmetic< order::little, uint_least8_t, 8 >       ulittle8_t;
0069   typedef endian_arithmetic< order::little, uint_least16_t, 16 >     ulittle16_t;
0070   typedef endian_arithmetic< order::little, uint_least32_t, 24 >     ulittle24_t;
0071   typedef endian_arithmetic< order::little, uint_least32_t, 32 >     ulittle32_t;
0072   typedef endian_arithmetic< order::little, uint_least64_t, 40 >     ulittle40_t;
0073   typedef endian_arithmetic< order::little, uint_least64_t, 48 >     ulittle48_t;
0074   typedef endian_arithmetic< order::little, uint_least64_t, 56 >     ulittle56_t;
0075   typedef endian_arithmetic< order::little, uint_least64_t, 64 >     ulittle64_t;
0076 
0077   // unaligned native endian_arithmetic signed integer types
0078   typedef endian_arithmetic< order::native, int_least8_t, 8 >        native8_t;
0079   typedef endian_arithmetic< order::native, int_least16_t, 16 >      native16_t;
0080   typedef endian_arithmetic< order::native, int_least32_t, 24 >      native24_t;
0081   typedef endian_arithmetic< order::native, int_least32_t, 32 >      native32_t;
0082   typedef endian_arithmetic< order::native, int_least64_t, 40 >      native40_t;
0083   typedef endian_arithmetic< order::native, int_least64_t, 48 >      native48_t;
0084   typedef endian_arithmetic< order::native, int_least64_t, 56 >      native56_t;
0085   typedef endian_arithmetic< order::native, int_least64_t, 64 >      native64_t;
0086 
0087   // unaligned native endian_arithmetic unsigned integer types
0088   typedef endian_arithmetic< order::native, uint_least8_t, 8 >       unative8_t;
0089   typedef endian_arithmetic< order::native, uint_least16_t, 16 >     unative16_t;
0090   typedef endian_arithmetic< order::native, uint_least32_t, 24 >     unative24_t;
0091   typedef endian_arithmetic< order::native, uint_least32_t, 32 >     unative32_t;
0092   typedef endian_arithmetic< order::native, uint_least64_t, 40 >     unative40_t;
0093   typedef endian_arithmetic< order::native, uint_least64_t, 48 >     unative48_t;
0094   typedef endian_arithmetic< order::native, uint_least64_t, 56 >     unative56_t;
0095   typedef endian_arithmetic< order::native, uint_least64_t, 64 >     unative64_t;
0096 
0097   // aligned native endian_arithmetic typedefs are not provided because
0098   // <cstdint> types are superior for this use case
0099 
0100   typedef endian_arithmetic< order::big, int16_t, 16, align::yes >      aligned_big16_t;
0101   typedef endian_arithmetic< order::big, uint16_t, 16, align::yes >     aligned_ubig16_t;
0102   typedef endian_arithmetic< order::little, int16_t, 16, align::yes >   aligned_little16_t;
0103   typedef endian_arithmetic< order::little, uint16_t, 16, align::yes >  aligned_ulittle16_t;
0104 
0105   typedef endian_arithmetic< order::big, int32_t, 32, align::yes >      aligned_big32_t;
0106   typedef endian_arithmetic< order::big, uint32_t, 32, align::yes >     aligned_ubig32_t;
0107   typedef endian_arithmetic< order::little, int32_t, 32, align::yes >   aligned_little32_t;
0108   typedef endian_arithmetic< order::little, uint32_t, 32, align::yes >  aligned_ulittle32_t;
0109 
0110   typedef endian_arithmetic< order::big, int64_t, 64, align::yes >      aligned_big64_t;
0111   typedef endian_arithmetic< order::big, uint64_t, 64, align::yes >     aligned_ubig64_t;
0112   typedef endian_arithmetic< order::little, int64_t, 64, align::yes >   aligned_little64_t;
0113   typedef endian_arithmetic< order::little, uint64_t, 64, align::yes >  aligned_ulittle64_t;
0114 
0115 } // namespace endian
0116 } // namespace boost
0117 
0118 #endif  //BOOST_ENDIAN_ENDIAN_HPP