mirror of
https://github.com/boostorg/endian.git
synced 2025-08-02 05:54:31 +02:00
Tweaks to get tests running with various compilers.
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
# include <boost/cstdint.hpp>
|
# include <boost/cstdint.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined __GNUC__ || defined __clang__)
|
#if ((defined __GNUC__ && !defined(__MINGW32__)) || defined __clang__)
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2 bswap_16
|
#define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2 bswap_16
|
||||||
#define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4 bswap_32
|
#define BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4 bswap_32
|
||||||
|
@@ -13,10 +13,17 @@
|
|||||||
#include <boost/detail/lightweight_main.hpp>
|
#include <boost/detail/lightweight_main.hpp>
|
||||||
#include <boost/detail/lightweight_test.hpp>
|
#include <boost/detail/lightweight_test.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
namespace be = boost::endian;
|
namespace be = boost::endian;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
using boost::int16_t;
|
||||||
|
using boost::uint16_t;
|
||||||
|
using boost::int32_t;
|
||||||
|
using boost::uint32_t;
|
||||||
|
using boost::int64_t;
|
||||||
|
using boost::uint64_t;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@@ -74,7 +74,7 @@ namespace
|
|||||||
++v; // verify integer_cover_operators being applied to this type -
|
++v; // verify integer_cover_operators being applied to this type -
|
||||||
// will fail to compile if no endian<> specialization is present
|
// will fail to compile if no endian<> specialization is present
|
||||||
|
|
||||||
auto x = v+v;
|
Endian x = v+v;
|
||||||
if ( x == x ) // silence warning
|
if ( x == x ) // silence warning
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user