forked from boostorg/core
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c95750f37 | |||
| a9f1407d84 | |||
| db0fd77af1 | |||
| 7cbbb08e7b |
@@ -228,30 +228,40 @@ jobs:
|
|||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-11
|
- clang-11
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-12
|
compiler: clang++-12
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-12
|
- clang-12
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-13
|
compiler: clang++-13
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-13
|
- clang-13
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-14
|
compiler: clang++-14
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-14
|
- clang-14
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-15
|
compiler: clang++-15
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
install:
|
install:
|
||||||
- clang-15
|
- clang-15
|
||||||
|
- g++-11
|
||||||
|
gcc_toolchain: 11
|
||||||
- toolset: clang
|
- toolset: clang
|
||||||
compiler: clang++-15
|
compiler: clang++-15
|
||||||
cxxstd: "03,11,14,17,20,2b"
|
cxxstd: "03,11,14,17,20,2b"
|
||||||
|
|||||||
@@ -47,12 +47,19 @@
|
|||||||
# if __has_builtin(__builtin_bit_cast)
|
# if __has_builtin(__builtin_bit_cast)
|
||||||
# define BOOST_CORE_HAS_BUILTIN_BIT_CAST
|
# define BOOST_CORE_HAS_BUILTIN_BIT_CAST
|
||||||
# endif
|
# endif
|
||||||
|
# if __has_builtin(__builtin_bswap16)
|
||||||
|
# define BOOST_CORE_HAS_BUILTIN_BSWAP16
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_MSVC) && BOOST_MSVC >= 1926
|
#if !defined(BOOST_CORE_HAS_BUILTIN_BIT_CAST) && (defined(BOOST_MSVC) && BOOST_MSVC >= 1926)
|
||||||
# define BOOST_CORE_HAS_BUILTIN_BIT_CAST
|
# define BOOST_CORE_HAS_BUILTIN_BIT_CAST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(BOOST_CORE_HAS_BUILTIN_BSWAP16) && (defined(BOOST_GCC) && BOOST_GCC >= 40800)
|
||||||
|
# define BOOST_CORE_HAS_BUILTIN_BSWAP16
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
namespace core
|
namespace core
|
||||||
@@ -825,11 +832,22 @@ BOOST_CONSTEXPR inline boost::uint8_t byteswap_impl( boost::uint8_t x ) BOOST_NO
|
|||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(BOOST_CORE_HAS_BUILTIN_BSWAP16)
|
||||||
|
|
||||||
|
BOOST_CONSTEXPR inline boost::uint16_t byteswap_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||||
|
{
|
||||||
|
return __builtin_bswap16( x );
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
BOOST_CONSTEXPR inline boost::uint16_t byteswap_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
BOOST_CONSTEXPR inline boost::uint16_t byteswap_impl( boost::uint16_t x ) BOOST_NOEXCEPT
|
||||||
{
|
{
|
||||||
return static_cast<boost::uint16_t>( x << 8 | x >> 8 );
|
return static_cast<boost::uint16_t>( x << 8 | x >> 8 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) || defined(__clang__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
|
|
||||||
BOOST_CXX14_CONSTEXPR inline boost::uint32_t byteswap_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
BOOST_CXX14_CONSTEXPR inline boost::uint32_t byteswap_impl( boost::uint32_t x ) BOOST_NOEXCEPT
|
||||||
|
|||||||
Reference in New Issue
Block a user