early-access version 3088

This commit is contained in:
pineappleEA
2022-11-05 15:35:56 +01:00
parent 4e4fc25ce3
commit b601909c6d
35519 changed files with 5996896 additions and 860 deletions

View File

@@ -0,0 +1,11 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
if(HAVE_BOOST_TEST)
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::endian Boost::core)
endif()

View File

@@ -0,0 +1,116 @@
# Boost Endian Library test Jamfile
# Copyright Beman Dawes 2006, 2013
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
# See library home page at http://www.boost.org/libs/endian
import testing ;
project
: default-build
<warnings>all
: requirements
<toolset>msvc:<warnings-as-errors>on
<toolset>gcc:<cxxflags>-Wno-long-long
<toolset>gcc-4.4.7:<cxxflags>-Wno-strict-aliasing
<toolset>gcc-4.4.7:<cxxflags>-Wno-sign-compare
<toolset>gcc:<warnings-as-errors>on
<toolset>clang:<cxxflags>-Wno-long-long
<toolset>clang:<warnings-as-errors>on
;
local rule run-ni ( sources + )
{
return [ run $(sources) : : : <define>BOOST_ENDIAN_NO_INTRINSICS : $(sources[1]:B)_ni ] ;
}
run buffer_test.cpp ;
run-ni buffer_test.cpp ;
run endian_test.cpp ;
run-ni endian_test.cpp ;
run endian_operations_test.cpp ;
run-ni endian_operations_test.cpp ;
run endian_in_union_test.cpp ;
run conversion_test.cpp ;
run-ni conversion_test.cpp ;
run intrinsic_test.cpp ;
run quick.cpp ;
local allow-warnings =
"-<toolset>msvc:<warnings-as-errors>on"
"-<toolset>gcc:<warnings-as-errors>on"
"-<toolset>clang:<warnings-as-errors>on" ;
compile spirit_conflict_test.cpp : $(allow-warnings) ;
run endian_reverse_test.cpp ;
run-ni endian_reverse_test.cpp ;
run endian_load_test.cpp ;
run-ni endian_load_test.cpp ;
run endian_store_test.cpp ;
run-ni endian_store_test.cpp ;
run endian_ld_st_roundtrip_test.cpp ;
run-ni endian_ld_st_roundtrip_test.cpp ;
run endian_arithmetic_test.cpp
: : : "<toolset>gcc,<address-model>32:<cxxflags>-ffloat-store" ;
run endian_arithmetic_test.cpp : : :
"<toolset>gcc,<address-model>32:<cxxflags>-ffloat-store" <define>BOOST_ENDIAN_NO_INTRINSICS : endian_arithmetic_test_ni ;
run deprecated_test.cpp ;
compile endian_reverse_cx_test.cpp ;
compile endian_reverse_cx_test.cpp : <define>BOOST_ENDIAN_NO_INTRINSICS : endian_reverse_cx_test_ni ;
run load_convenience_test.cpp ;
run-ni load_convenience_test.cpp ;
run store_convenience_test.cpp ;
run-ni store_convenience_test.cpp ;
run float_typedef_test.cpp ;
run-ni float_typedef_test.cpp ;
run data_test.cpp ;
run-ni data_test.cpp ;
run endian_hpp_test.cpp ;
run-ni endian_hpp_test.cpp ;
run order_test.cpp ;
run endian_reverse_test2.cpp ;
run-ni endian_reverse_test2.cpp ;
run is_scoped_enum_test.cpp ;
run endian_reverse_test3.cpp ;
run-ni endian_reverse_test3.cpp ;
run endian_reverse_test4.cpp ;
run-ni endian_reverse_test4.cpp ;
run endian_reverse_test5.cpp ;
run-ni endian_reverse_test5.cpp ;
run packed_buffer_test.cpp ;
run arithmetic_buffer_test.cpp ;
run packed_arithmetic_test.cpp ;

View File

@@ -0,0 +1,45 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/arithmetic.hpp>
#include <boost/endian/buffers.hpp>
#include <boost/core/lightweight_test.hpp>
template<class A, class B> void test()
{
A a( 5 );
BOOST_TEST_EQ( a.value(), 5 );
B& b = a;
BOOST_TEST_EQ( b.value(), 5 );
b = 14;
BOOST_TEST_EQ( b.value(), 14 );
BOOST_TEST_EQ( a.value(), 14 );
A const& ca = a;
BOOST_TEST_EQ( ca.value(), 14 );
B const& cb = b;
BOOST_TEST_EQ( cb.value(), 14 );
a = 31;
BOOST_TEST_EQ( a.value(), 31 );
BOOST_TEST_EQ( b.value(), 31 );
BOOST_TEST_EQ( ca.value(), 31 );
BOOST_TEST_EQ( cb.value(), 31 );
}
int main()
{
using namespace boost::endian;
test<big_int16_t, big_int16_buf_t>();
test<little_int32_t, little_int32_buf_t>();
return boost::report_errors();
}

View File

@@ -0,0 +1,233 @@
// benchmark.cpp ---------------------------------------------------------------------//
// Copyright Beman Dawes 2011
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#ifndef _SCL_SECURE_NO_WARNINGS
# define _SCL_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#include <cstdlib>
#include <boost/endian/conversion.hpp>
#include <boost/random.hpp>
#include <boost/cstdint.hpp>
#include <boost/timer/timer.hpp>
#include <iostream>
#include <string>
using namespace boost;
using std::cout;
using std::cerr;
using std::endl;
using std::vector;
namespace
{
std::string command_args;
long long n_cases;
int places = 2;
bool verbose (false);
#ifndef BOOST_TWO_ARG
typedef int32_t (*timee_func)(int32_t);
#else
typedef void (*timee_func)(int32_t, int32_t&);
#endif
typedef boost::timer::nanosecond_type nanosecond_t;
//--------------------------------------------------------------------------------------//
nanosecond_t benchmark(timee_func timee, const char* msg,
nanosecond_t overhead = 0)
// Returns: total cpu time (i.e. system time + user time)
{
if (verbose)
cout << "\nRunning benchmark..." << endl;
int64_t sum = 0;
boost::timer::cpu_times times;
nanosecond_t cpu_time;
boost::timer::auto_cpu_timer t(places);
for (long long i = n_cases; i; --i)
{
# ifndef BOOST_TWO_ARG
sum += timee(static_cast<int32_t>(i)) ;
# else
int32_t y;
timee(static_cast<int32_t>(i), y);
sum += y;
# endif
}
t.stop();
times = t.elapsed();
cpu_time = (times.system + times.user) - overhead;
const long double sec = 1000000000.0L;
cout.setf(std::ios_base::fixed, std::ios_base::floatfield);
cout.precision(places);
cout << msg << " " << cpu_time / sec << endl;
if (verbose)
{
t.report();
cout << " Benchmark complete\n"
" sum is " << sum << endl;
}
return cpu_time;
}
void process_command_line(int argc, char * argv[])
{
for (int a = 0; a < argc; ++a)
{
command_args += argv[a];
if (a != argc-1)
command_args += ' ';
}
cout << command_args << '\n';;
if (argc >=2)
#ifndef _MSC_VER
n_cases = std::atoll(argv[1]);
#else
n_cases = _atoi64(argv[1]);
#endif
for (; argc > 2; ++argv, --argc)
{
if ( *(argv[2]+1) == 'p' )
places = atoi( argv[2]+2 );
else if ( *(argv[2]+1) == 'v' )
verbose = true;
else
{
cout << "Error - unknown option: " << argv[2] << "\n\n";
argc = -1;
break;
}
}
if (argc < 2)
{
cout << "Usage: benchmark n [Options]\n"
" The argument n specifies the number of test cases to run\n"
" Options:\n"
" -v Verbose messages\n"
" -p# Decimal places for times; default -p" << places << "\n";
return std::exit(1);
}
}
inline void inplace(int32_t& x)
{
x = (static_cast<uint32_t>(x) << 24)
| ((static_cast<uint32_t>(x) << 8) & 0x00ff0000)
| ((static_cast<uint32_t>(x) >> 8) & 0x0000ff00)
| (static_cast<uint32_t>(x) >> 24);
}
inline int32_t by_return(int32_t x)
{
return (static_cast<uint32_t>(x) << 24)
| ((static_cast<uint32_t>(x) << 8) & 0x00ff0000)
| ((static_cast<uint32_t>(x) >> 8) & 0x0000ff00)
| (static_cast<uint32_t>(x) >> 24);
}
inline int32_t by_return_intrinsic(int32_t x)
{
return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(static_cast<uint32_t>(x));
}
inline int32_t by_return_pyry(int32_t x)
{
uint32_t step16;
step16 = static_cast<uint32_t>(x) << 16 | static_cast<uint32_t>(x) >> 16;
return
((static_cast<uint32_t>(step16) << 8) & 0xff00ff00)
| ((static_cast<uint32_t>(step16) >> 8) & 0x00ff00ff);
}
inline int32_t two_operand(int32_t x, int32_t& y)
{
return y = ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) | ((x >> 24) & 0x000000ff)
| ((x >> 8) & 0x0000ff00);
}
inline int32_t modify_noop(int32_t x)
{
int32_t v(x);
return v;
}
inline int32_t modify_inplace(int32_t x)
{
int32_t v(x);
inplace(v);
return v;
}
inline int32_t modify_by_return(int32_t x)
{
int32_t v(x);
return by_return(v);
}
inline int32_t modify_by_return_pyry(int32_t x)
{
int32_t v(x);
return by_return_pyry(v);
}
inline int32_t modify_by_return_intrinsic(int32_t x)
{
int32_t v(x);
return by_return_intrinsic(v);
}
inline void non_modify_assign(int32_t x, int32_t& y)
{
y = x;
}
inline void non_modify_two_operand(int32_t x, int32_t& y)
{
two_operand(x, y);
}
inline void non_modify_by_return(int32_t x, int32_t& y)
{
y = by_return(x);
}
} // unnamed namespace
//-------------------------------------- main() ---------------------------------------//
int main(int argc, char * argv[])
{
process_command_line(argc, argv);
nanosecond_t overhead;
#ifndef BOOST_TWO_ARG
overhead = benchmark(modify_noop, "modify no-op");
benchmark(modify_inplace, "modify in place"/*, overhead*/);
benchmark(modify_by_return, "modify by return"/*, overhead*/);
benchmark(modify_by_return_pyry, "modify by return_pyry"/*, overhead*/);
benchmark(modify_by_return_intrinsic, "modify by return_intrinsic"/*, overhead*/);
#else
overhead = benchmark(non_modify_assign, "non_modify_assign ");
benchmark(non_modify_two_operand, "non_modify_two_operand", overhead);
benchmark(non_modify_by_return, "non_modify_by_return ", overhead);
#endif
return 0;
}

View File

@@ -0,0 +1,337 @@
// buffer_test.cpp -------------------------------------------------------------------//
// Copyright Beman Dawes 2014
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See library home page at http://www.boost.org/libs/endian
//--------------------------------------------------------------------------------------//
#include <boost/endian/detail/disable_warnings.hpp>
#include <boost/endian/buffers.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/cstdint.hpp>
#include <iostream>
#include <sstream>
#include <limits>
using namespace boost::endian;
using std::cout;
using std::endl;
namespace
{
// check_size ------------------------------------------------------------//
void check_size()
{
BOOST_TEST_EQ(sizeof(big_int8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(big_int16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(big_int24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(big_int32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(big_int40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(big_int48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(big_int56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(big_int64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(big_uint8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(big_uint16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(big_uint24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(big_uint32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(big_uint40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(big_uint48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(big_uint56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(big_uint64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(big_float32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(big_float64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(little_int8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(little_int16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(little_int24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(little_int32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(little_int40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(little_int48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(little_int56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(little_int64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(little_uint8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(little_uint16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(little_uint24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(little_uint32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(little_uint40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(little_uint48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(little_uint56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(little_uint64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(little_float32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(little_float64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(native_int8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(native_int16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(native_int24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(native_int32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(native_int40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(native_int48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(native_int56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(native_int64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(native_uint8_buf_t), 1u);
BOOST_TEST_EQ(sizeof(native_uint16_buf_t), 2u);
BOOST_TEST_EQ(sizeof(native_uint24_buf_t), 3u);
BOOST_TEST_EQ(sizeof(native_uint32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(native_uint40_buf_t), 5u);
BOOST_TEST_EQ(sizeof(native_uint48_buf_t), 6u);
BOOST_TEST_EQ(sizeof(native_uint56_buf_t), 7u);
BOOST_TEST_EQ(sizeof(native_uint64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(native_float32_buf_t), 4u);
BOOST_TEST_EQ(sizeof(native_float64_buf_t), 8u);
BOOST_TEST_EQ(sizeof(big_int8_buf_at), 1u);
BOOST_TEST_EQ(sizeof(big_int16_buf_at), 2u);
BOOST_TEST_EQ(sizeof(big_int32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(big_int64_buf_at), 8u);
BOOST_TEST_EQ(sizeof(big_uint8_buf_at), 1u);
BOOST_TEST_EQ(sizeof(big_uint16_buf_at), 2u);
BOOST_TEST_EQ(sizeof(big_uint32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(big_uint64_buf_at), 8u);
BOOST_TEST_EQ(sizeof(big_float32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(big_float64_buf_at), 8u);
BOOST_TEST_EQ(sizeof(little_int8_buf_at), 1u);
BOOST_TEST_EQ(sizeof(little_int16_buf_at), 2u);
BOOST_TEST_EQ(sizeof(little_int32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(little_int64_buf_at), 8u);
BOOST_TEST_EQ(sizeof(little_uint8_buf_at), 1u);
BOOST_TEST_EQ(sizeof(little_uint16_buf_at), 2u);
BOOST_TEST_EQ(sizeof(little_uint32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(little_uint64_buf_at), 8u);
BOOST_TEST_EQ(sizeof(little_float32_buf_at), 4u);
BOOST_TEST_EQ(sizeof(little_float64_buf_at), 8u);
} // check_size
// test_inserter_and_extractor -----------------------------------------------------//
void test_inserter_and_extractor()
{
std::cout << "test inserter and extractor..." << std::endl;
big_uint64_buf_t bu64(0x010203040506070ULL);
little_uint64_buf_t lu64(0x010203040506070ULL);
boost::uint64_t x;
std::stringstream ss;
ss << bu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << lu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << 0x010203040506070ULL;
big_uint64_buf_t bu64z(0);
ss >> bu64z;
BOOST_TEST_EQ(bu64z.value(), bu64.value());
ss.clear();
ss << 0x010203040506070ULL;
little_uint64_buf_t lu64z(0);
ss >> lu64z;
BOOST_TEST_EQ(lu64z.value(), lu64.value());
std::cout << "test inserter and extractor complete" << std::endl;
}
template<class T> struct unaligned
{
char x;
T y;
};
template<class T> void test_buffer_type( typename T::value_type v1, typename T::value_type v2 )
{
T buffer( v1 );
BOOST_TEST_EQ( buffer.value(), v1 );
buffer = v2;
BOOST_TEST_EQ( buffer.value(), v2 );
unaligned<T> buffer2 = { 0, T( v1 ) };
BOOST_TEST_EQ( buffer2.y.value(), v1 );
buffer2.y = v2;
BOOST_TEST_EQ( buffer2.y.value(), v2 );
}
void test_construction_and_assignment()
{
std::cout << "test construction and assignment..." << std::endl;
test_buffer_type< big_int8_buf_at>( 0x01, -0x01 );
test_buffer_type<big_int16_buf_at>( 0x0102, -0x0102 );
test_buffer_type<big_int32_buf_at>( 0x01020304, -0x01020304 );
test_buffer_type<big_int64_buf_at>( 0x0102030405060708LL, -0x0102030405060708LL );
test_buffer_type< big_uint8_buf_at>( 0x01, 0xFE );
test_buffer_type<big_uint16_buf_at>( 0x0102, 0xFE02 );
test_buffer_type<big_uint32_buf_at>( 0x01020304, 0xFE020304 );
test_buffer_type<big_uint64_buf_at>( 0x0102030405060708ULL, 0xFE02030405060708ULL );
test_buffer_type<big_float32_buf_at>( +1.5f, -3.14f );
test_buffer_type<big_float64_buf_at>( +1.5, -3.14 );
test_buffer_type< little_int8_buf_at>( 0x01, -0x01 );
test_buffer_type<little_int16_buf_at>( 0x0102, -0x0102 );
test_buffer_type<little_int32_buf_at>( 0x01020304, -0x01020304 );
test_buffer_type<little_int64_buf_at>( 0x0102030405060708LL, -0x0102030405060708LL );
test_buffer_type< little_uint8_buf_at>( 0x01, 0xFE );
test_buffer_type<little_uint16_buf_at>( 0x0102, 0xFE02 );
test_buffer_type<little_uint32_buf_at>( 0x01020304, 0xFE020304 );
test_buffer_type<little_uint64_buf_at>( 0x0102030405060708ULL, 0xFE02030405060708ULL );
test_buffer_type<little_float32_buf_at>( +1.5f, -3.14f );
test_buffer_type<little_float64_buf_at>( +1.5, -3.14 );
test_buffer_type< big_int8_buf_t>( 0x01, -0x01 );
test_buffer_type<big_int16_buf_t>( 0x0102, -0x0102 );
test_buffer_type<big_int24_buf_t>( 0x010203, -0x010203 );
test_buffer_type<big_int32_buf_t>( 0x01020304, -0x01020304 );
test_buffer_type<big_int40_buf_t>( 0x0102030405LL, -0x0102030405LL );
test_buffer_type<big_int48_buf_t>( 0x010203040506LL, -0x010203040506LL );
test_buffer_type<big_int56_buf_t>( 0x01020304050607LL, -0x01020304050607LL );
test_buffer_type<big_int64_buf_t>( 0x0102030405060708LL, -0x0102030405060708LL );
test_buffer_type<big_float32_buf_t>( +1.5f, -3.14f );
test_buffer_type<big_float64_buf_t>( +1.5, -3.14 );
test_buffer_type< little_uint8_buf_t>( 0x01, 0xFE );
test_buffer_type<little_uint16_buf_t>( 0x0102, 0xFE02 );
test_buffer_type<little_uint24_buf_t>( 0x010203, 0xFE0203 );
test_buffer_type<little_uint32_buf_t>( 0x01020304, 0xFE020304 );
test_buffer_type<little_uint40_buf_t>( 0x0102030405ULL, 0xFE02030405ULL );
test_buffer_type<little_uint48_buf_t>( 0x010203040506ULL, 0xFE0203040506ULL );
test_buffer_type<little_uint56_buf_t>( 0x01020304050607ULL, 0xFE020304050607ULL );
test_buffer_type<little_uint64_buf_t>( 0x0102030405060708ULL, 0xFE02030405060708ULL );
test_buffer_type<little_float32_buf_t>( +1.5f, -3.14f );
test_buffer_type<little_float64_buf_t>( +1.5, -3.14 );
std::cout << "test construction and assignment complete" << std::endl;
}
template <typename T>
void test_boundary_values_()
{
test_buffer_type< endian_buffer<order::big, T, sizeof(T) * CHAR_BIT, align::no > >( std::numeric_limits<T>::min(), std::numeric_limits<T>::max() );
test_buffer_type< endian_buffer<order::little, T, sizeof(T) * CHAR_BIT, align::no > >( std::numeric_limits<T>::min(), std::numeric_limits<T>::max() );
test_buffer_type< endian_buffer<order::big, T, sizeof(T) * CHAR_BIT, align::yes> >( std::numeric_limits<T>::min(), std::numeric_limits<T>::max() );
test_buffer_type< endian_buffer<order::little, T, sizeof(T) * CHAR_BIT, align::yes> >( std::numeric_limits<T>::min(), std::numeric_limits<T>::max() );
}
void test_boundary_values()
{
std::cout << "test boundary values..." << std::endl;
// integer types
test_boundary_values_<signed char>();
test_boundary_values_<unsigned char>();
test_boundary_values_<signed short>();
test_boundary_values_<unsigned short>();
test_boundary_values_<signed int>();
test_boundary_values_<unsigned int>();
test_boundary_values_<signed long>();
test_boundary_values_<unsigned long>();
test_boundary_values_<signed long long>();
test_boundary_values_<unsigned long long>();
// character types
test_boundary_values_<char>();
#if !defined(BOOST_NO_CXX11_CHAR16_T)
test_boundary_values_<char16_t>();
#endif
#if !defined(BOOST_NO_CXX11_CHAR32_T)
test_boundary_values_<char32_t>();
#endif
// floating-point types
test_boundary_values_<float>();
test_boundary_values_<double>();
std::cout << "test boundary values complete" << std::endl;
}
} // unnamed namespace
//--------------------------------------------------------------------------------------//
int cpp_main(int, char *[])
{
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
cout << " construct big endian aligned" << endl;
big_int32_buf_at x(1122334455);
cout << " assign to buffer from built-in integer" << endl;
x = 1234567890;
cout << " operator==(buffer.value(), built-in)" << endl;
bool b1(x.value() == 1234567890);
BOOST_TEST(b1);
cout << " construct little endian unaligned" << endl;
little_int32_buf_t x2(1122334455);
cout << " assign to buffer from built-in integer" << endl;
x2 = 1234567890;
cout << " operator==(buffer.value(), built-in)" << endl;
bool b2(x2.value() == 1234567890);
BOOST_TEST(b2);
check_size();
test_inserter_and_extractor();
test_construction_and_assignment();
test_boundary_values();
cout << " done" << endl;
return ::boost::report_errors();
}
int main( int argc, char* argv[] )
{
try
{
return cpp_main( argc, argv );
}
catch( std::exception const & x )
{
BOOST_ERROR( x.what() );
return boost::report_errors();
}
}
#include <boost/endian/detail/disable_warnings_pop.hpp>

View File

@@ -0,0 +1,18 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_install_test LANGUAGES CXX)
find_package(boost_endian REQUIRED)
find_package(boost_core REQUIRED)
add_executable(quick ../quick.cpp)
target_link_libraries(quick Boost::endian Boost::core)
enable_testing()
add_test(quick quick)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,39 @@
# Copyright 2018, 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.5...3.16)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../.. boostorg/endian)
# boost_add_subdir
function(boost_add_subdir name)
add_subdirectory(../../../${name} boostorg/${name})
endfunction()
# primary dependencies
boost_add_subdir(config)
boost_add_subdir(core)
boost_add_subdir(static_assert)
boost_add_subdir(type_traits)
# secondary dependencies
boost_add_subdir(assert)
boost_add_subdir(throw_exception)
# --target check
add_executable(quick ../quick.cpp)
target_link_libraries(quick Boost::endian Boost::core)
enable_testing()
add_test(quick quick)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

View File

@@ -0,0 +1,398 @@
// conversion_test.cpp ---------------------------------------------------------------//
// Copyright Beman Dawes 2010
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
#if defined(_MSC_VER)
# pragma warning( disable: 4127 ) // conditional expression is constant
# if _MSC_VER < 1500
# pragma warning( disable: 4267 ) // '+=': possible loss of data
# endif
#endif
#include <boost/endian/detail/disable_warnings.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/make_unsigned.hpp>
#include <boost/static_assert.hpp>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstddef>
namespace be = boost::endian;
using std::cout;
using std::endl;
using boost::int8_t;
using boost::uint8_t;
using boost::int16_t;
using boost::uint16_t;
using boost::int32_t;
using boost::uint32_t;
using boost::int64_t;
using boost::uint64_t;
template <class T> inline T std_endian_reverse(T x) BOOST_NOEXCEPT
{
T tmp(x);
std::reverse( reinterpret_cast<unsigned char*>(&tmp), reinterpret_cast<unsigned char*>(&tmp) + sizeof(T) );
return tmp;
}
namespace
{
// values for tests
static unsigned char const test_value_bytes[] = { 0xF1, 0x02, 0xE3, 0x04, 0xD5, 0x06, 0xC7, 0x08 };
template<class T> void native_value( T& x )
{
BOOST_STATIC_ASSERT( boost::is_integral<T>::value && sizeof( T ) <= 8 );
std::memcpy( &x, test_value_bytes, sizeof( x ) );
}
template<class T> void little_value( T& x )
{
BOOST_STATIC_ASSERT( boost::is_integral<T>::value && sizeof( T ) <= 8 );
typedef typename boost::make_unsigned<T>::type U;
x = 0;
for( std::size_t i = 0; i < sizeof( x ); ++i )
{
x += static_cast<U>( test_value_bytes[ i ] ) << ( 8 * i );
}
}
template<class T> void big_value( T& x )
{
BOOST_STATIC_ASSERT( boost::is_integral<T>::value && sizeof( T ) <= 8 );
typedef typename boost::make_unsigned<T>::type U;
x = 0;
for( std::size_t i = 0; i < sizeof( x ); ++i )
{
x += static_cast<U>( test_value_bytes[ i ] ) << ( 8 * ( sizeof( x ) - i - 1 ) );
}
}
template <class T>
void test()
{
T native;
T big;
T little;
native_value(native);
big_value(big);
little_value(little);
// validate the values used by the tests below
if( be::order::native == be::order::big )
{
BOOST_TEST_EQ(native, big);
BOOST_TEST_EQ(::std_endian_reverse(native), little);
}
else
{
BOOST_TEST_EQ(::std_endian_reverse(native), big);
BOOST_TEST_EQ(native, little);
}
// value-by-value tests
// unconditional reverse
BOOST_TEST_EQ(be::endian_reverse(big), little);
BOOST_TEST_EQ(be::endian_reverse(little), big);
// conditional reverse
BOOST_TEST_EQ(be::native_to_big(native), big);
BOOST_TEST_EQ(be::native_to_little(native), little);
BOOST_TEST_EQ(be::big_to_native(big), native);
BOOST_TEST_EQ(be::little_to_native(little), native);
// generic conditional reverse
BOOST_TEST_EQ((be::conditional_reverse<be::order::big, be::order::big>(big)), big);
BOOST_TEST_EQ((be::conditional_reverse<be::order::little,
be::order::little>(little)), little);
BOOST_TEST_EQ((be::conditional_reverse<be::order::native,
be::order::native>(native)), native);
BOOST_TEST_EQ((be::conditional_reverse<be::order::big,
be::order::little>(big)), little);
BOOST_TEST_EQ((be::conditional_reverse<be::order::big,
be::order::native>(big)), native);
BOOST_TEST_EQ((be::conditional_reverse<be::order::little,
be::order::big>(little)), big);
BOOST_TEST_EQ((be::conditional_reverse<be::order::little,
be::order::native>(little)), native);
BOOST_TEST_EQ((be::conditional_reverse<be::order::native,
be::order::big>(native)), big);
BOOST_TEST_EQ((be::conditional_reverse<be::order::native,
be::order::little>(native)), little);
// runtime conditional reverse
BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big, be::order::big)),
big);
BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little,
be::order::little)), little);
BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native,
be::order::native)), native);
BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big,
be::order::little)), little);
BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big,
be::order::native)), native);
BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little,
be::order::big)), big);
BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little,
be::order::native)), native);
BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native,
be::order::big)), big);
BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native,
be::order::little)), little);
// modify-in-place tests
T x;
// unconditional reverse
x = big; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, little);
x = little; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, big);
// conditional reverse
x = native; be::native_to_big_inplace(x); BOOST_TEST_EQ(x, big);
x = native; be::native_to_little_inplace(x); BOOST_TEST_EQ(x, little);
x = big; be::big_to_native_inplace(x); BOOST_TEST_EQ(x, native);
x = little; be::little_to_native_inplace(x); BOOST_TEST_EQ(x, native);
// generic conditional reverse
x = big; be::conditional_reverse_inplace<be::order::big, be::order::big>(x);
BOOST_TEST_EQ(x, big);
x = little; be::conditional_reverse_inplace<be::order::little, be::order::little>(x);
BOOST_TEST_EQ(x, little);
x = native; be::conditional_reverse_inplace<be::order::native, be::order::native>(x);
BOOST_TEST_EQ(x, native);
x = big; be::conditional_reverse_inplace<be::order::big, be::order::little>(x);
BOOST_TEST_EQ(x, little);
x = big; be::conditional_reverse_inplace<be::order::big, be::order::native>(x);
BOOST_TEST_EQ(x, native);
x = little; be::conditional_reverse_inplace<be::order::little, be::order::big>(x);
BOOST_TEST_EQ(x, big);
x = little; be::conditional_reverse_inplace<be::order::little, be::order::native>(x);
BOOST_TEST_EQ(x, native);
x = native; be::conditional_reverse_inplace<be::order::native, be::order::big>(x);
BOOST_TEST_EQ(x, big);
x = native; be::conditional_reverse_inplace<be::order::native, be::order::little>(x);
BOOST_TEST_EQ(x, little);
// runtime conditional reverse
x = big;
be::conditional_reverse_inplace(x, be::order::big, be::order::big);
BOOST_TEST_EQ(x, big);
x = little;
be::conditional_reverse_inplace(x, be::order::little, be::order::little);
BOOST_TEST_EQ(x, little);
x = native;
be::conditional_reverse_inplace(x, be::order::native, be::order::native);
BOOST_TEST_EQ(x, native);
x = big;
be::conditional_reverse_inplace(x, be::order::big, be::order::little);
BOOST_TEST_EQ(x, little);
x = big;
be::conditional_reverse_inplace(x, be::order::big, be::order::native);
BOOST_TEST_EQ(x, native);
x = little;
be::conditional_reverse_inplace(x, be::order::little, be::order::big);
BOOST_TEST_EQ(x, big);
x = little;
be::conditional_reverse_inplace(x, be::order::little, be::order::native);
BOOST_TEST_EQ(x, native);
x = native;
be::conditional_reverse_inplace(x, be::order::native, be::order::big);
BOOST_TEST_EQ(x, big);
x = native;
be::conditional_reverse_inplace(x, be::order::native, be::order::little);
BOOST_TEST_EQ(x, little);
}
//--------------------------------------------------------------------------------------//
template <class UDT>
void udt_test()
{
UDT udt, tmp;
int64_t big;
int64_t little;
int64_t native;
big_value(big);
little_value(little);
native_value(native);
udt.member1 = big;
udt.member2 = little;
udt.member3 = native;
tmp = be::conditional_reverse<be::order::big, be::order::little>(udt);
BOOST_TEST_EQ(tmp.member1, be::endian_reverse(big));
BOOST_TEST_EQ(tmp.member2, be::endian_reverse(little));
BOOST_TEST_EQ(tmp.member3, be::endian_reverse(native));
be::conditional_reverse_inplace<be::order::big, be::order::little>(udt);
BOOST_TEST_EQ(udt.member1, be::endian_reverse(big));
BOOST_TEST_EQ(udt.member2, be::endian_reverse(little));
BOOST_TEST_EQ(udt.member3, be::endian_reverse(native));
udt.member1 = big;
udt.member2 = little;
udt.member3 = native;
tmp.member1 = tmp.member2 = tmp.member3 = 0;
tmp = be::conditional_reverse<be::order::big, be::order::big>(udt);
BOOST_TEST_EQ(tmp.member1, big);
BOOST_TEST_EQ(tmp.member2, little);
BOOST_TEST_EQ(tmp.member3, native);
be::conditional_reverse_inplace<be::order::big, be::order::big>(udt);
BOOST_TEST_EQ(udt.member1, big);
BOOST_TEST_EQ(udt.member2, little);
BOOST_TEST_EQ(udt.member3, native);
}
} // unnamed namespace
//--------------------------------------------------------------------------------------//
// User-defined types
namespace user
{
// UDT1 supplies both endian_reverse and endian_reverse_inplace
struct UDT1
{
int64_t member1;
int64_t member2;
int64_t member3;
};
UDT1 endian_reverse(const UDT1& udt) BOOST_NOEXCEPT
{
UDT1 tmp;
tmp.member1 = boost::endian::endian_reverse(udt.member1);
tmp.member2 = boost::endian::endian_reverse(udt.member2);
tmp.member3 = boost::endian::endian_reverse(udt.member3);
return tmp;
}
void endian_reverse_inplace(UDT1& udt) BOOST_NOEXCEPT
{
boost::endian::endian_reverse_inplace(udt.member1);
boost::endian::endian_reverse_inplace(udt.member2);
boost::endian::endian_reverse_inplace(udt.member3);
}
// UDT2 supplies only endian_reverse
struct UDT2
{
int64_t member1;
int64_t member2;
int64_t member3;
};
UDT2 endian_reverse(const UDT2& udt) BOOST_NOEXCEPT
{
UDT2 tmp;
tmp.member1 = boost::endian::endian_reverse(udt.member1);
tmp.member2 = boost::endian::endian_reverse(udt.member2);
tmp.member3 = boost::endian::endian_reverse(udt.member3);
return tmp;
}
// UDT3 supplies neither endian_reverse nor endian_reverse_inplace,
// so udt_test<UDT3>() should fail to compile
struct UDT3
{
int64_t member1;
int64_t member2;
int64_t member3;
};
} // namespace user
//--------------------------------------------------------------------------------------//
int cpp_main(int, char * [])
{
if( be::order::native == be::order::little )
{
cout << "Little endian" << endl;
}
else if( be::order::native == be::order::big )
{
cout << "Big endian" << endl;
}
else
{
cout << "Unknown endian" << endl;
}
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
//std::cerr << std::hex;
cout << "int8_t" << endl;
test<int8_t>();
cout << "uint8_t" << endl;
test<uint8_t>();
cout << "int16_t" << endl;
test<int16_t>();
cout << "uint16_t" << endl;
test<uint16_t>();
cout << "int32_t" << endl;
test<int32_t>();
cout << "uint32_t" << endl;
test<uint32_t>();
cout << "int64_t" << endl;
test<int64_t>();
cout << "uint64_t" << endl;
test<uint64_t>();
cout << "UDT 1" << endl;
udt_test<user::UDT1>();
cout << "UDT 2" << endl;
udt_test<user::UDT2>();
#ifdef BOOST_ENDIAN_COMPILE_FAIL
cout << "UDT 3" << endl;
udt_test<user::UDT3>(); // should fail to compile since has not endian_reverse()
#endif
return ::boost::report_errors();
}
int main( int argc, char* argv[] )
{
try
{
return cpp_main( argc, argv );
}
catch( std::exception const & x )
{
BOOST_ERROR( x.what() );
return boost::report_errors();
}
}
#include <boost/endian/detail/disable_warnings_pop.hpp>

View File

@@ -0,0 +1,95 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/arithmetic.hpp>
#include <boost/endian/buffers.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
template<class U> void test()
{
{
U u( 0 );
unsigned char * p1 = u.data();
void * p2 = &u;
BOOST_TEST_EQ( p1, p2 );
}
{
U const u( 0 );
unsigned char const * p1 = u.data();
void const * p2 = &u;
BOOST_TEST_EQ( p1, p2 );
}
}
template<class T, std::size_t Bits> void test_unaligned()
{
using namespace boost::endian;
test< endian_buffer<order::big, T, Bits, align::no> >();
test< endian_buffer<order::little, T, Bits, align::no> >();
test< endian_buffer<order::native, T, Bits, align::no> >();
test< endian_arithmetic<order::big, T, Bits, align::no> >();
test< endian_arithmetic<order::little, T, Bits, align::no> >();
test< endian_arithmetic<order::native, T, Bits, align::no> >();
}
template<class T, std::size_t Bits> void test_aligned()
{
using namespace boost::endian;
test< endian_buffer<order::big, T, Bits, align::yes> >();
test< endian_buffer<order::little, T, Bits, align::yes> >();
test< endian_arithmetic<order::big, T, Bits, align::yes> >();
test< endian_arithmetic<order::little, T, Bits, align::yes> >();
}
int main()
{
test_unaligned<boost::int_least8_t, 8>();
test_unaligned<boost::int_least16_t, 16>();
test_unaligned<boost::int_least32_t, 24>();
test_unaligned<boost::int_least32_t, 32>();
test_unaligned<boost::int_least64_t, 40>();
test_unaligned<boost::int_least64_t, 48>();
test_unaligned<boost::int_least64_t, 56>();
test_unaligned<boost::int_least64_t, 64>();
test_unaligned<boost::uint_least8_t, 8>();
test_unaligned<boost::uint_least16_t, 16>();
test_unaligned<boost::uint_least32_t, 24>();
test_unaligned<boost::uint_least32_t, 32>();
test_unaligned<boost::uint_least64_t, 40>();
test_unaligned<boost::uint_least64_t, 48>();
test_unaligned<boost::uint_least64_t, 56>();
test_unaligned<boost::uint_least64_t, 64>();
test_unaligned<float, 32>();
test_unaligned<double, 64>();
test_aligned<boost::int8_t, 8>();
test_aligned<boost::int16_t, 16>();
test_aligned<boost::int32_t, 32>();
test_aligned<boost::int64_t, 64>();
test_aligned<boost::uint8_t, 8>();
test_aligned<boost::uint16_t, 16>();
test_aligned<boost::uint32_t, 32>();
test_aligned<boost::uint64_t, 64>();
test_aligned<float, 32>();
test_aligned<double, 64>();
return boost::report_errors();
}

View File

@@ -0,0 +1,196 @@
// deprecated_test.cpp ---------------------------------------------------------------//
// Copyright Beman Dawes 2014, 2015
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See library home page at http://www.boost.org/libs/endian
//--------------------------------------------------------------------------------------//
#include <boost/endian/detail/disable_warnings.hpp>
#define BOOST_ENDIAN_DEPRECATED_NAMES
#include <boost/endian/endian.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/cstdint.hpp>
#include <iostream>
#include <sstream>
using namespace boost::endian;
using std::cout;
using std::endl;
namespace
{
// check_size ----------------------------------------------------------------------//
void check_size()
{
BOOST_TEST_EQ(sizeof(big8_t), 1);
BOOST_TEST_EQ(sizeof(big16_t), 2);
BOOST_TEST_EQ(sizeof(big24_t), 3);
BOOST_TEST_EQ(sizeof(big32_t), 4);
BOOST_TEST_EQ(sizeof(big40_t), 5);
BOOST_TEST_EQ(sizeof(big48_t), 6);
BOOST_TEST_EQ(sizeof(big56_t), 7);
BOOST_TEST_EQ(sizeof(big64_t), 8);
BOOST_TEST_EQ(sizeof(ubig8_t), 1);
BOOST_TEST_EQ(sizeof(ubig16_t), 2);
BOOST_TEST_EQ(sizeof(ubig24_t), 3);
BOOST_TEST_EQ(sizeof(ubig32_t), 4);
BOOST_TEST_EQ(sizeof(ubig40_t), 5);
BOOST_TEST_EQ(sizeof(ubig48_t), 6);
BOOST_TEST_EQ(sizeof(ubig56_t), 7);
BOOST_TEST_EQ(sizeof(ubig64_t), 8);
BOOST_TEST_EQ(sizeof(little8_t), 1);
BOOST_TEST_EQ(sizeof(little16_t), 2);
BOOST_TEST_EQ(sizeof(little24_t), 3);
BOOST_TEST_EQ(sizeof(little32_t), 4);
BOOST_TEST_EQ(sizeof(little40_t), 5);
BOOST_TEST_EQ(sizeof(little48_t), 6);
BOOST_TEST_EQ(sizeof(little56_t), 7);
BOOST_TEST_EQ(sizeof(little64_t), 8);
BOOST_TEST_EQ(sizeof(ulittle8_t), 1);
BOOST_TEST_EQ(sizeof(ulittle16_t), 2);
BOOST_TEST_EQ(sizeof(ulittle24_t), 3);
BOOST_TEST_EQ(sizeof(ulittle32_t), 4);
BOOST_TEST_EQ(sizeof(ulittle40_t), 5);
BOOST_TEST_EQ(sizeof(ulittle48_t), 6);
BOOST_TEST_EQ(sizeof(ulittle56_t), 7);
BOOST_TEST_EQ(sizeof(ulittle64_t), 8);
BOOST_TEST_EQ(sizeof(native8_t), 1);
BOOST_TEST_EQ(sizeof(native16_t), 2);
BOOST_TEST_EQ(sizeof(native24_t), 3);
BOOST_TEST_EQ(sizeof(native32_t), 4);
BOOST_TEST_EQ(sizeof(native40_t), 5);
BOOST_TEST_EQ(sizeof(native48_t), 6);
BOOST_TEST_EQ(sizeof(native56_t), 7);
BOOST_TEST_EQ(sizeof(native64_t), 8);
BOOST_TEST_EQ(sizeof(unative8_t), 1);
BOOST_TEST_EQ(sizeof(unative16_t), 2);
BOOST_TEST_EQ(sizeof(unative24_t), 3);
BOOST_TEST_EQ(sizeof(unative32_t), 4);
BOOST_TEST_EQ(sizeof(unative40_t), 5);
BOOST_TEST_EQ(sizeof(unative48_t), 6);
BOOST_TEST_EQ(sizeof(unative56_t), 7);
BOOST_TEST_EQ(sizeof(unative64_t), 8);
BOOST_TEST_EQ(sizeof(aligned_big16_t), 2);
BOOST_TEST_EQ(sizeof(aligned_big32_t), 4);
BOOST_TEST_EQ(sizeof(aligned_big64_t), 8);
BOOST_TEST_EQ(sizeof(aligned_ubig16_t), 2);
BOOST_TEST_EQ(sizeof(aligned_ubig32_t), 4);
BOOST_TEST_EQ(sizeof(aligned_ubig64_t), 8);
BOOST_TEST_EQ(sizeof(aligned_little16_t), 2);
BOOST_TEST_EQ(sizeof(aligned_little32_t), 4);
BOOST_TEST_EQ(sizeof(aligned_little64_t), 8);
BOOST_TEST_EQ(sizeof(aligned_ulittle16_t), 2);
BOOST_TEST_EQ(sizeof(aligned_ulittle32_t), 4);
BOOST_TEST_EQ(sizeof(aligned_ulittle64_t), 8);
# ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES
BOOST_TEST_EQ(sizeof(endian<endianness::big, int_least16_t, 16>), 2);
BOOST_TEST_EQ(sizeof(endian<endianness::big,
int_least16_t, 16, alignment::unaligned>), 2);
# endif
} // check_size
// test_inserter_and_extractor -----------------------------------------------------//
void test_inserter_and_extractor()
{
std::cout << "test inserter and extractor..." << std::endl;
ubig64_t bu64(0x010203040506070ULL);
ulittle64_t lu64(0x010203040506070ULL);
boost::uint64_t x;
std::stringstream ss;
ss << bu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << lu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << 0x010203040506070ULL;
ubig64_t bu64z(0);
ss >> bu64z;
BOOST_TEST_EQ(bu64z, bu64);
ss.clear();
ss << 0x010203040506070ULL;
ulittle64_t lu64z(0);
ss >> lu64z;
BOOST_TEST_EQ(lu64z, lu64);
std::cout << "test inserter and extractor complete" << std::endl;
}
} // unnamed namespace
//--------------------------------------------------------------------------------------//
int cpp_main(int, char *[])
{
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
cout << " construct big endian aligned" << endl;
big32_t x(1122334455);
cout << " assign to buffer from built-in integer" << endl;
x = 1234567890;
cout << " operator==(buffer.value(), built-in)" << endl;
bool b1(x == 1234567890);
BOOST_TEST(b1);
cout << " construct little endian unaligned" << endl;
little32_t x2(1122334455);
cout << " assign to buffer from built-in integer" << endl;
x2 = 1234567890;
cout << " operator==(buffer.value(), built-in)" << endl;
bool b2(x2 == 1234567890);
BOOST_TEST(b2);
check_size();
test_inserter_and_extractor();
cout << " done" << endl;
return ::boost::report_errors();
}
int main( int argc, char* argv[] )
{
try
{
return cpp_main( argc, argv );
}
catch( std::exception const & x )
{
BOOST_ERROR( x.what() );
return boost::report_errors();
}
}
#include <boost/endian/detail/disable_warnings_pop.hpp>

View File

@@ -0,0 +1,164 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/arithmetic.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
template<BOOST_SCOPED_ENUM(boost::endian::order) Order, BOOST_SCOPED_ENUM(boost::endian::align) Align, class T> void test_arithmetic_( T const& x )
{
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y( x );
BOOST_TEST_EQ( +x, +y );
BOOST_TEST_EQ( x + x, y + y );
BOOST_TEST_EQ( x - x, y - y );
BOOST_TEST_EQ( x * x, y * y );
BOOST_TEST_EQ( x / x, y / y );
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 += x, y2 += y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 -= x, y2 -= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 *= x, y2 *= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 /= x, y2 /= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( ++x2, ++y2 );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( --x2, --y2 );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2++, y2++ );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2--, y2-- );
}
}
template<BOOST_SCOPED_ENUM(boost::endian::order) Order, BOOST_SCOPED_ENUM(boost::endian::align) Align, class T> void test_integral_( T const& x )
{
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y( x );
BOOST_TEST_EQ( x % x, y % y );
BOOST_TEST_EQ( x & x, y & y );
BOOST_TEST_EQ( x | x, y | y );
BOOST_TEST_EQ( x ^ x, y ^ y );
BOOST_TEST_EQ( x << 1, y << 1 );
BOOST_TEST_EQ( x >> 1, y >> 1 );
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 %= x, y2 %= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 &= x, y2 &= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 |= x, y2 |= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 ^= x, y2 ^= y );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 <<= 1, y2 <<= 1 );
}
{
T x2( x );
boost::endian::endian_arithmetic<Order, T, sizeof(T) * 8, Align> y2( y );
BOOST_TEST_EQ( x2 >>= 1, y2 >>= 1 );
}
}
template<class T> void test_arithmetic( T const& x )
{
test_arithmetic_<boost::endian::order::little, boost::endian::align::no>( x );
test_arithmetic_<boost::endian::order::little, boost::endian::align::yes>( x );
test_arithmetic_<boost::endian::order::big, boost::endian::align::no>( x );
test_arithmetic_<boost::endian::order::big, boost::endian::align::yes>( x );
}
template<class T> void test_integral( T const& x )
{
test_arithmetic( x );
test_integral_<boost::endian::order::little, boost::endian::align::no>( x );
test_integral_<boost::endian::order::little, boost::endian::align::yes>( x );
test_integral_<boost::endian::order::big, boost::endian::align::no>( x );
test_integral_<boost::endian::order::big, boost::endian::align::yes>( x );
}
int main()
{
test_integral( 0x7EF2 );
test_integral( 0x01020304u );
test_arithmetic( 3.1416f );
test_arithmetic( 3.14159 );
return boost::report_errors();
}

View File

@@ -0,0 +1,59 @@
// Copyright 2019 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
using namespace boost::endian;
// conversion
{
BOOST_TEST_EQ( endian_reverse( 0x01020304 ), 0x04030201 );
}
// buffers
{
little_uint32_buf_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x04 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x01 );
}
{
big_uint32_buf_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x01 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x04 );
}
// arithmetic
{
little_uint32_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x04 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x01 );
}
{
big_uint32_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x01 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x04 );
}
return boost::report_errors();
}

View File

@@ -0,0 +1,81 @@
// endian_in_union_test.cpp -------------------------------------------------//
// Copyright Beman Dawes 2008
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/endian
//----------------------------------------------------------------------------//
#define BOOST_ENDIAN_FORCE_PODNESS
#include <boost/endian/detail/disable_warnings.hpp>
#include <boost/endian/arithmetic.hpp>
using namespace boost::endian;
union U
{
big_int8_t big_8;
big_int16_t big_16;
big_int24_t big_24;
big_int32_t big_32;
big_int40_t big_40;
big_int48_t big_48;
big_int56_t big_56;
big_int64_t big_64;
big_uint8_t big_u8;
big_uint16_t big_u16;
big_uint24_t big_u24;
big_uint32_t big_u32;
big_uint40_t big_u40;
big_uint48_t big_u48;
big_uint56_t big_u56;
big_uint64_t big_u64;
little_int8_t little_8;
little_int16_t little_16;
little_int24_t little_24;
little_int32_t little_32;
little_int40_t little_40;
little_int48_t little_48;
little_int56_t little_56;
little_int64_t little_64;
little_uint8_t little_u8;
little_uint16_t little_u16;
little_uint24_t little_u24;
little_uint32_t little_u32;
little_uint40_t little_u40;
little_uint48_t little_u48;
little_uint56_t little_u56;
little_uint64_t little_u64;
native_int8_t native_8;
native_int16_t native_16;
native_int24_t native_24;
native_int32_t native_32;
native_int40_t native_40;
native_int48_t native_48;
native_int56_t native_56;
native_int64_t native_64;
native_uint8_t native_u8;
native_uint16_t native_u16;
native_uint24_t native_u24;
native_uint32_t native_u32;
native_uint40_t native_u40;
native_uint48_t native_u48;
native_uint56_t native_u56;
native_uint64_t native_u64;
};
U foo;
int main()
{
}

View File

@@ -0,0 +1,45 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
template<class T> void test( T const& x )
{
{
unsigned char buffer[ sizeof(T) ];
boost::endian::endian_store<T, sizeof(T), boost::endian::order::little>( buffer, x );
T x2 = boost::endian::endian_load<T, sizeof(T), boost::endian::order::little>( buffer );
BOOST_TEST_EQ( x, x2 );
}
{
unsigned char buffer[ sizeof(T) ];
boost::endian::endian_store<T, sizeof(T), boost::endian::order::big>( buffer, x );
T x2 = boost::endian::endian_load<T, sizeof(T), boost::endian::order::big>( buffer );
BOOST_TEST_EQ( x, x2 );
}
}
enum E
{
e = 0xF1F2F3
};
int main()
{
test( 1.2e+34f );
test( -1.234e+56 );
test( e );
return boost::report_errors();
}

View File

@@ -0,0 +1,263 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
int main()
{
{
unsigned char v[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 };
// 1 -> 1
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int8_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint8_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int8_t, 1, boost::endian::order::big>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint8_t, 1, boost::endian::order::big>( v )), 0x01 );
// 1 -> 2
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 1, boost::endian::order::big>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 1, boost::endian::order::big>( v )), 0x01 );
// 2 -> 2
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 2, boost::endian::order::big>( v )), 0x0102 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 2, boost::endian::order::big>( v )), 0x0102 );
// 1 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 1, boost::endian::order::big>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 1, boost::endian::order::big>( v )), 0x01 );
// 2 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 2, boost::endian::order::big>( v )), 0x0102 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 2, boost::endian::order::big>( v )), 0x0102 );
// 3 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 3, boost::endian::order::little>( v )), 0x030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 3, boost::endian::order::little>( v )), 0x030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 3, boost::endian::order::big>( v )), 0x010203 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 3, boost::endian::order::big>( v )), 0x010203 );
// 4 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 4, boost::endian::order::little>( v )), 0x04030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 4, boost::endian::order::little>( v )), 0x04030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 4, boost::endian::order::big>( v )), 0x01020304 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 4, boost::endian::order::big>( v )), 0x01020304 );
// 1 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 1, boost::endian::order::little>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 1, boost::endian::order::big>( v )), 0x01 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 1, boost::endian::order::big>( v )), 0x01 );
// 2 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 2, boost::endian::order::little>( v )), 0x0201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 2, boost::endian::order::big>( v )), 0x0102 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 2, boost::endian::order::big>( v )), 0x0102 );
// 3 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 3, boost::endian::order::little>( v )), 0x030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 3, boost::endian::order::little>( v )), 0x030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 3, boost::endian::order::big>( v )), 0x010203 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 3, boost::endian::order::big>( v )), 0x010203 );
// 4 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 4, boost::endian::order::little>( v )), 0x04030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 4, boost::endian::order::little>( v )), 0x04030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 4, boost::endian::order::big>( v )), 0x01020304 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 4, boost::endian::order::big>( v )), 0x01020304 );
// 5 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 5, boost::endian::order::little>( v )), 0x0504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 5, boost::endian::order::little>( v )), 0x0504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 5, boost::endian::order::big>( v )), 0x0102030405 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 5, boost::endian::order::big>( v )), 0x0102030405 );
// 6 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 6, boost::endian::order::little>( v )), 0x060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 6, boost::endian::order::little>( v )), 0x060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 6, boost::endian::order::big>( v )), 0x010203040506 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 6, boost::endian::order::big>( v )), 0x010203040506 );
// 7 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 7, boost::endian::order::little>( v )), 0x07060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 7, boost::endian::order::little>( v )), 0x07060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 7, boost::endian::order::big>( v )), 0x01020304050607 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 7, boost::endian::order::big>( v )), 0x01020304050607 );
// 8 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 8, boost::endian::order::little>( v )), 0x0807060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 8, boost::endian::order::little>( v )), 0x0807060504030201 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 8, boost::endian::order::big>( v )), 0x0102030405060708 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 8, boost::endian::order::big>( v )), 0x0102030405060708 );
}
{
unsigned char v[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8 };
// 1 -> 1
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int8_t, 1, boost::endian::order::little>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint8_t, 1, boost::endian::order::little>( v )), 0xF1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int8_t, 1, boost::endian::order::big>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint8_t, 1, boost::endian::order::big>( v )), 0xF1 );
// 1 -> 2
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 1, boost::endian::order::little>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 1, boost::endian::order::little>( v )), 0xF1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 1, boost::endian::order::big>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 1, boost::endian::order::big>( v )), 0xF1 );
// 2 -> 2
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 2, boost::endian::order::little>( v )), -3343 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 2, boost::endian::order::little>( v )), 0xF2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int16_t, 2, boost::endian::order::big>( v )), -3598 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint16_t, 2, boost::endian::order::big>( v )), 0xF1F2 );
// 1 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 1, boost::endian::order::little>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 1, boost::endian::order::little>( v )), 0xF1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 1, boost::endian::order::big>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 1, boost::endian::order::big>( v )), 0xF1 );
// 2 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 2, boost::endian::order::little>( v )), -3343 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 2, boost::endian::order::little>( v )), 0xF2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 2, boost::endian::order::big>( v )), -3598 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 2, boost::endian::order::big>( v )), 0xF1F2 );
// 3 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 3, boost::endian::order::little>( v )), -789775 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 3, boost::endian::order::little>( v )), 0xF3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 3, boost::endian::order::big>( v )), -920845 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 3, boost::endian::order::big>( v )), 0xF1F2F3 );
// 4 -> 4
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 4, boost::endian::order::little>( v )), 0xF4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 4, boost::endian::order::little>( v )), 0xF4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int32_t, 4, boost::endian::order::big>( v )), 0xF1F2F3F4 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint32_t, 4, boost::endian::order::big>( v )), 0xF1F2F3F4 );
// 1 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 1, boost::endian::order::little>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 1, boost::endian::order::little>( v )), 0xF1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 1, boost::endian::order::big>( v )), -15 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 1, boost::endian::order::big>( v )), 0xF1 );
// 2 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 2, boost::endian::order::little>( v )), -3343 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 2, boost::endian::order::little>( v )), 0xF2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 2, boost::endian::order::big>( v )), -3598 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 2, boost::endian::order::big>( v )), 0xF1F2 );
// 3 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 3, boost::endian::order::little>( v )), -789775 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 3, boost::endian::order::little>( v )), 0xF3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 3, boost::endian::order::big>( v )), -920845 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 3, boost::endian::order::big>( v )), 0xF1F2F3 );
// 4 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 4, boost::endian::order::little>( v )), -185339151 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 4, boost::endian::order::little>( v )), 0xF4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 4, boost::endian::order::big>( v )), -235736076 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 4, boost::endian::order::big>( v )), 0xF1F2F3F4 );
// 5 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 5, boost::endian::order::little>( v )), -43135012111 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 5, boost::endian::order::little>( v )), 0xF5F4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 5, boost::endian::order::big>( v )), -60348435211 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 5, boost::endian::order::big>( v )), 0xF1F2F3F4F5 );
// 6 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 6, boost::endian::order::little>( v )), -9938739662095 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 6, boost::endian::order::little>( v )), 0xF6F5F4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 6, boost::endian::order::big>( v )), -15449199413770 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 6, boost::endian::order::big>( v )), 0xF1F2F3F4F5F6 );
// 7 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 7, boost::endian::order::little>( v )), -2261738553347343 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 7, boost::endian::order::little>( v )), 0xF7F6F5F4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 7, boost::endian::order::big>( v )), -3954995049924873 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 7, boost::endian::order::big>( v )), 0xF1F2F3F4F5F6F7 );
// 8 -> 8
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 8, boost::endian::order::little>( v )), 0xF8F7F6F5F4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 8, boost::endian::order::little>( v )), 0xF8F7F6F5F4F3F2F1 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::int64_t, 8, boost::endian::order::big>( v )), 0xF1F2F3F4F5F6F7F8 );
BOOST_TEST_EQ( (boost::endian::endian_load<boost::uint64_t, 8, boost::endian::order::big>( v )), 0xF1F2F3F4F5F6F7F8 );
}
return boost::report_errors();
}

View File

@@ -0,0 +1,503 @@
// endian_operations_test.cpp --------------------------------------------------------//
// Copyright Beman Dawes 2008
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See library home page at http://www.boost.org/libs/endian
//--------------------------------------------------------------------------------------//
// This test probes operator overloading, including interaction between
// operand types.
// See endian_test for tests of endianness correctness, size, and value.
#include <boost/endian/detail/disable_warnings.hpp>
#ifdef _MSC_VER
# pragma warning( disable : 4242 ) // conversion ..., possible loss of data
# pragma warning( disable : 4244 ) // conversion ..., possible loss of data
# pragma warning( disable : 4018 ) // signed/unsigned mismatch
# pragma warning( disable : 4365 ) // signed/unsigned mismatch
# pragma warning( disable : 4389 ) // signed/unsigned mismatch
#elif defined(__GNUC__)
# pragma GCC diagnostic ignored "-Wconversion"
#endif
#include <boost/endian/arithmetic.hpp>
#include <boost/type_traits/is_signed.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/cstdint.hpp>
#include <cassert>
#include <iostream>
#include <sstream>
namespace be = boost::endian;
template <class T>
struct value_type
{
typedef typename T::value_type type;
};
template<> struct value_type<char> { typedef char type; };
template<> struct value_type<unsigned char> { typedef unsigned char type; };
template<> struct value_type<signed char> { typedef signed char type; };
template<> struct value_type<short> { typedef short type; };
template<> struct value_type<unsigned short> { typedef unsigned short type; };
template<> struct value_type<int> { typedef int type; };
template<> struct value_type<unsigned int> { typedef unsigned int type; };
template<> struct value_type<long> { typedef long type; };
template<> struct value_type<unsigned long> { typedef unsigned long type; };
template<> struct value_type<long long> { typedef long long type; };
template<> struct value_type<unsigned long long> { typedef unsigned long long type; };
template <class T1, class T2>
struct default_construct
{
static void test()
{
T1 o1;
o1 = 1; // quiet warnings
if (o1) return; // quiet warnings
}
};
template <class T1, class T2>
struct construct
{
static void test()
{
T2 o2(1);
T1 o1(static_cast<T1>(o2));
++o1; // quiet gcc unused variable warning
}
};
template <class T1, class T2>
struct initialize
{
static void test()
{
T1 o2(2);
T1 o1 = o2;
++o1; // quiet gcc unused variable warning
}
};
template <class T1, class T2>
struct assign
{
static void test()
{
T2 o2;
o2 = 1;
T1 o1;
o1 = o2;
if (o1) return; // quiet warnings
}
};
template <class T1, class T2, bool SameSignedness>
struct do_relational
{
static void test()
{
T1 o1(1);
T2 o2(2);
BOOST_TEST( !(o1 == o2) );
BOOST_TEST( o1 != o2 );
BOOST_TEST( o1 < o2 );
BOOST_TEST( o1 <= o2 );
BOOST_TEST( !(o1 > o2) );
BOOST_TEST( !(o1 >= o2 ) );
}
};
template <class T1, class T2>
struct do_relational<T1, T2, false>
{
static void test()
{
}
};
template <class T1, class T2>
struct relational
{
static void test()
{
do_relational<T1, T2,
boost::is_signed<typename value_type<T1>::type>::value
== boost::is_signed<typename value_type<T2>::type>::value
>::test();
// do_relational<T1, T2, true>::test();
}
};
template <class T1, class T2>
struct op_plus
{
static void test()
{
T1 o1(1);
T2 o2(2);
T1 o3;
o3 = +o1;
o3 = o1 + o2;
o1 += o2;
if (o3) return; // quiet warnings
}
};
template <class T1, class T2>
struct op_star
{
static void test()
{
T1 o1(1);
T2 o2(2);
T1 o3;
o3 = o1 * o2;
o1 *= o2;
if (o3) return; // quiet warnings
}
};
template <template<class, class> class Test, class T1>
void op_test_aux()
{
Test<T1, char>::test();
Test<T1, unsigned char>::test();
Test<T1, signed char>::test();
Test<T1, short>::test();
Test<T1, unsigned short>::test();
Test<T1, int>::test();
Test<T1, unsigned int>::test();
Test<T1, long>::test();
Test<T1, unsigned long>::test();
Test<T1, long long>::test();
Test<T1, unsigned long long>::test();
Test<T1, be::big_int16_at>::test();
Test<T1, be::big_int32_at>::test();
Test<T1, be::big_int64_at>::test();
Test<T1, be::big_uint16_at>::test();
Test<T1, be::big_uint32_at>::test();
Test<T1, be::big_uint64_at>::test();
Test<T1, be::little_int16_at>::test();
Test<T1, be::little_int32_at>::test();
Test<T1, be::little_int64_at>::test();
Test<T1, be::little_uint16_at>::test();
Test<T1, be::little_uint32_at>::test();
Test<T1, be::little_uint64_at>::test();
Test<T1, be::big_int8_t>::test();
Test<T1, be::big_int16_t>::test();
Test<T1, be::big_int24_t>::test();
Test<T1, be::big_int32_t>::test();
Test<T1, be::big_int40_t>::test();
Test<T1, be::big_int48_t>::test();
Test<T1, be::big_int56_t>::test();
Test<T1, be::big_int64_t>::test();
Test<T1, be::big_uint8_t>::test();
Test<T1, be::big_uint16_t>::test();
Test<T1, be::big_uint24_t>::test();
Test<T1, be::big_uint32_t>::test();
Test<T1, be::big_uint40_t>::test();
Test<T1, be::big_uint64_t>::test();
Test<T1, be::little_int16_t>::test();
Test<T1, be::little_int24_t>::test();
Test<T1, be::little_int32_t>::test();
Test<T1, be::little_int64_t>::test();
Test<T1, be::little_uint16_t>::test();
Test<T1, be::little_uint32_t>::test();
Test<T1, be::little_uint56_t>::test();
Test<T1, be::little_uint64_t>::test();
Test<T1, be::native_int16_t>::test();
Test<T1, be::native_int24_t>::test();
Test<T1, be::native_int32_t>::test();
Test<T1, be::native_int64_t>::test();
#ifdef BOOST_LONG_ENDIAN_TEST
Test<T1, be::native_uint16_t>::test();
Test<T1, be::native_uint24_t>::test();
Test<T1, be::native_uint32_t>::test();
Test<T1, be::native_uint48_t>::test();
Test<T1, be::native_uint64_t>::test();
Test<T1, be::big_uint48_t>::test();
Test<T1, be::big_uint56_t>::test();
Test<T1, be::little_int8_t>::test();
Test<T1, be::little_int56_t>::test();
Test<T1, be::little_int40_t>::test();
Test<T1, be::little_int48_t>::test();
Test<T1, be::little_uint8_t>::test();
Test<T1, be::little_uint24_t>::test();
Test<T1, be::little_uint40_t>::test();
Test<T1, be::little_uint48_t>::test();
Test<T1, be::native_int8_t>::test();
Test<T1, be::native_int40_t>::test();
Test<T1, be::native_int48_t>::test();
Test<T1, be::native_int56_t>::test();
Test<T1, be::native_uint8_t>::test();
Test<T1, be::native_uint40_t>::test();
Test<T1, be::native_uint56_t>::test();
#endif
}
template <template<class, class> class Test>
void op_test()
{
op_test_aux<Test, char>();
op_test_aux<Test, unsigned char>();
op_test_aux<Test, signed char>();
op_test_aux<Test, short>();
op_test_aux<Test, unsigned short>();
op_test_aux<Test, int>();
op_test_aux<Test, unsigned int>();
op_test_aux<Test, long>();
op_test_aux<Test, unsigned long>();
op_test_aux<Test, long long>();
op_test_aux<Test, unsigned long long>();
op_test_aux<Test, be::big_int16_at>();
op_test_aux<Test, be::big_int32_at>();
op_test_aux<Test, be::big_int64_at>();
op_test_aux<Test, be::little_int16_at>();
op_test_aux<Test, be::little_int32_at>();
op_test_aux<Test, be::little_int64_at>();
#ifdef BOOST_LONG_ENDIAN_TEST
op_test_aux<Test, be::big_int8_t>();
op_test_aux<Test, be::big_int16_t>();
op_test_aux<Test, be::big_int24_t>();
op_test_aux<Test, be::big_int32_t>();
op_test_aux<Test, be::big_int40_t>();
op_test_aux<Test, be::big_int48_t>();
op_test_aux<Test, be::big_int56_t>();
op_test_aux<Test, be::big_int64_t>();
op_test_aux<Test, be::big_uint8_t>();
op_test_aux<Test, be::big_uint16_t>();
op_test_aux<Test, be::big_uint24_t>();
op_test_aux<Test, be::big_uint32_t>();
op_test_aux<Test, be::big_uint40_t>();
op_test_aux<Test, be::big_uint48_t>();
op_test_aux<Test, be::big_uint56_t>();
op_test_aux<Test, be::big_uint64_t>();
op_test_aux<Test, be::little_int8_t>();
op_test_aux<Test, be::little_int16_t>();
op_test_aux<Test, be::little_int24_t>();
op_test_aux<Test, be::little_int32_t>();
op_test_aux<Test, be::little_int40_t>();
op_test_aux<Test, be::little_int48_t>();
op_test_aux<Test, be::little_int56_t>();
op_test_aux<Test, be::little_int64_t>();
op_test_aux<Test, be::little_uint8_t>();
op_test_aux<Test, be::little_uint16_t>();
op_test_aux<Test, be::little_uint24_t>();
op_test_aux<Test, be::little_uint32_t>();
op_test_aux<Test, be::little_uint40_t>();
op_test_aux<Test, be::little_uint48_t>();
op_test_aux<Test, be::little_uint56_t>();
op_test_aux<Test, be::little_uint64_t>();
op_test_aux<Test, be::native_int8_t>();
op_test_aux<Test, be::native_int16_t>();
op_test_aux<Test, be::native_int24_t>();
op_test_aux<Test, be::native_int32_t>();
op_test_aux<Test, be::native_int40_t>();
op_test_aux<Test, be::native_int48_t>();
op_test_aux<Test, be::native_int56_t>();
op_test_aux<Test, be::native_int64_t>();
op_test_aux<Test, be::native_uint8_t>();
op_test_aux<Test, be::native_uint16_t>();
op_test_aux<Test, be::native_uint24_t>();
op_test_aux<Test, be::native_uint32_t>();
op_test_aux<Test, be::native_uint40_t>();
op_test_aux<Test, be::native_uint48_t>();
op_test_aux<Test, be::native_uint56_t>();
op_test_aux<Test, be::native_uint64_t>();
#endif
}
// test_inserter_and_extractor -----------------------------------------------------//
void test_inserter_and_extractor()
{
std::cout << "test inserter and extractor..." << std::endl;
be::big_uint64_t bu64(0x010203040506070ULL);
be::little_uint64_t lu64(0x010203040506070ULL);
boost::uint64_t x;
std::stringstream ss;
ss << bu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << lu64;
ss >> x;
BOOST_TEST_EQ(x, 0x010203040506070ULL);
ss.clear();
ss << 0x010203040506070ULL;
be::big_uint64_t bu64z(0);
ss >> bu64z;
BOOST_TEST_EQ(bu64z, bu64);
ss.clear();
ss << 0x010203040506070ULL;
be::little_uint64_t lu64z(0);
ss >> lu64z;
BOOST_TEST_EQ(lu64z, lu64);
std::cout << "test inserter and extractor complete" << std::endl;
}
void f_big_int32_ut(be::big_int32_t) {}
// main ------------------------------------------------------------------------------//
int cpp_main(int, char * [])
{
// make sure some simple things work
be::big_int32_t o1(1);
be::big_int32_t o2(2L);
be::big_int32_t o3(3LL);
be::big_int64_t o4(1);
std::clog << "set up test values\n";
be::big_int32_t big(12345);
be::little_uint16_t little_u(10);
be::big_int64_t result;
// this is the use case that is so irritating that it caused the endian
// constructors to be made non-explicit
std::clog << "\nf(1234) where f(big_int32_t)\n";
f_big_int32_ut(1234);
std::clog << "\nresult = big\n";
result = big;
std::clog << "\nresult = +big\n";
result = +big;
std::clog << "\nresult = -big\n";
result = -big;
std::clog << "\n++big\n";
++big;
std::clog << "\nresult = big++\n";
result = big++;
std::clog << "\n--big\n";
--big;
std::clog << "\nbig--\n";
big--;
std::clog << "\nresult = big * big\n";
result = big * big;
std::clog << "\nresult = big * big\n";
result = big * big;
std::clog << "\nresult = big * little_u\n";
result = big * little_u;
std::clog << "\nbig *= little_u\n";
big *= little_u;
std::clog << "\nresult = little_u * big\n";
result = little_u * big;
std::clog << "\nresult = big * 5\n";
result = big * 5;
std::clog << "\nbig *= 5\n";
big *= 5;
std::clog << "\nresult = 5 * big\n";
result = 5 * big;
std::clog << "\nresult = little_u * 5\n";
result = little_u * 5;
std::clog << "\nresult = 5 * little_u\n";
result = 5 * little_u;
std::clog << "\nresult = 5 * 10\n";
result = 5 * 10;
std::clog << "\n";
// test from Roland Schwarz that detected ambiguities; these ambiguities
// were eliminated by BOOST_ENDIAN_MINIMAL_COVER_OPERATORS
unsigned u;
be::little_uint32_t u1;
be::little_uint32_t u2;
u = 9;
u1 = 1;
std::clog << "\nu2 = u1 + u\n";
u2 = u1 + u;
std::clog << "\n";
// variations to detect ambiguities
be::little_uint32_t u3 = u1 + 5;
u3 = u1 + 5u;
if (u1 == 5)
{}
if (u1 == 5u)
{}
u1 += 5;
u1 += 5u;
u2 = u1 + 5;
u2 = u1 + 5u;
// one more wrinkle
be::little_uint16_t u4(3);
u4 = 3;
std::clog << "\nu2 = u1 + u4\n";
u2 = u1 + u4;
std::clog << "\n";
test_inserter_and_extractor();
// perform the indicated test on ~60*60 operand types
op_test<default_construct>();
op_test<construct>(); // includes copy construction
op_test<initialize>();
op_test<assign>();
op_test<relational>();
op_test<op_plus>();
op_test<op_star>();
return boost::report_errors();
}
int main( int argc, char* argv[] )
{
try
{
return cpp_main( argc, argv );
}
catch( std::exception const & x )
{
BOOST_ERROR( x.what() );
return boost::report_errors();
}
}

View File

@@ -0,0 +1,40 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/config/pragma_message.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#if defined(BOOST_NO_CXX11_CONSTEXPR)
BOOST_PRAGMA_MESSAGE("Test skipped because BOOST_NO_CXX11_CONSTEXPR is defined")
#elif defined(BOOST_ENDIAN_NO_INTRINSICS) && defined(BOOST_NO_CXX14_CONSTEXPR)
BOOST_PRAGMA_MESSAGE("Test skipped because BOOST_ENDIAN_NO_INTRINSICS and BOOST_NO_CXX14_CONSTEXPR are defined")
#elif !defined(BOOST_ENDIAN_NO_INTRINSICS) && !defined(BOOST_ENDIAN_CONSTEXPR_INTRINSICS)
BOOST_PRAGMA_MESSAGE("Test skipped because BOOST_ENDIAN_NO_INTRINSICS and BOOST_ENDIAN_CONSTEXPR_INTRINSICS are not defined")
#else
using namespace boost::endian;
#define STATIC_ASSERT(expr) static_assert(expr, #expr)
STATIC_ASSERT( endian_reverse( static_cast<boost::uint8_t>( 0x01 ) ) == 0x01 );
STATIC_ASSERT( endian_reverse( static_cast<boost::uint16_t>( 0x0102 ) ) == 0x0201 );
STATIC_ASSERT( endian_reverse( static_cast<boost::uint32_t>( 0x01020304 ) ) == 0x04030201 );
STATIC_ASSERT( endian_reverse( static_cast<boost::uint64_t>( 0x0102030405060708 ) ) == 0x0807060504030201 );
STATIC_ASSERT( big_to_native( native_to_big( 0x01020304 ) ) == 0x01020304 );
STATIC_ASSERT( little_to_native( native_to_little( 0x01020304 ) ) == 0x01020304 );
STATIC_ASSERT( native_to_big( 0x01020304 ) == (conditional_reverse<order::native, order::big>( 0x01020304 )) );
STATIC_ASSERT( native_to_big( 0x01020304 ) == conditional_reverse( 0x01020304, order::native, order::big ) );
#endif

View File

@@ -0,0 +1,223 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning( disable: 4309 ) // static_cast: truncation of constant value
#endif
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cstddef>
template<class T, std::size_t N = sizeof(T)> struct test_value
{
};
template<class T> struct test_value<T, 1>
{
static const T v1 = static_cast<T>( 0x1F );
static const T w1 = static_cast<T>( 0x1F );
static const T v2 = static_cast<T>( 0xF1 );
static const T w2 = static_cast<T>( 0xF1 );
};
template<class T> T const test_value<T, 1>::v1;
template<class T> T const test_value<T, 1>::w1;
template<class T> T const test_value<T, 1>::v2;
template<class T> T const test_value<T, 1>::w2;
template<class T> struct test_value<T, 2>
{
static const T v1 = static_cast<T>( 0x1F2E );
static const T w1 = static_cast<T>( 0x2E1F );
static const T v2 = static_cast<T>( 0xF1E2 );
static const T w2 = static_cast<T>( 0xE2F1 );
};
template<class T> T const test_value<T, 2>::v1;
template<class T> T const test_value<T, 2>::w1;
template<class T> T const test_value<T, 2>::v2;
template<class T> T const test_value<T, 2>::w2;
template<class T> struct test_value<T, 4>
{
static const T v1 = static_cast<T>( 0x1F2E3D4C );
static const T w1 = static_cast<T>( 0x4C3D2E1F );
static const T v2 = static_cast<T>( 0xF1E2D3C4 );
static const T w2 = static_cast<T>( 0xC4D3E2F1 );
};
template<class T> T const test_value<T, 4>::v1;
template<class T> T const test_value<T, 4>::w1;
template<class T> T const test_value<T, 4>::v2;
template<class T> T const test_value<T, 4>::w2;
template<class T> struct test_value<T, 8>
{
static const T v1 = static_cast<T>( 0x1F2E3D4C5B6A7988ull );
static const T w1 = static_cast<T>( 0x88796A5B4C3D2E1Full );
static const T v2 = static_cast<T>( 0xF1E2D3C4B5A69788ull );
static const T w2 = static_cast<T>( 0x8897A6B5C4D3E2F1ull );
};
template<class T> T const test_value<T, 8>::v1;
template<class T> T const test_value<T, 8>::w1;
template<class T> T const test_value<T, 8>::v2;
template<class T> T const test_value<T, 8>::w2;
#if defined(BOOST_HAS_INT128)
template<class T> struct test_value<T, 16>
{
static const T v1 = static_cast<T>( 0x1F2E3D4C5B6A7988ull ) << 64 | static_cast<T>( 0xF1E2D3C4B5A69780ull );
static const T w1 = static_cast<T>( 0x8097A6B5C4D3E2F1ull ) << 64 | static_cast<T>( 0x88796A5B4C3D2E1Full );
static const T v2 = static_cast<T>( 0xF1E2D3C4B5A69788ull ) << 64 | static_cast<T>( 0x1F2E3D4C5B6A7980ull );
static const T w2 = static_cast<T>( 0x80796A5B4C3D2E1Full ) << 64 | static_cast<T>( 0x8897A6B5C4D3E2F1ull );
};
template<class T> T const test_value<T, 16>::v1;
template<class T> T const test_value<T, 16>::w1;
template<class T> T const test_value<T, 16>::v2;
template<class T> T const test_value<T, 16>::w2;
#endif // #if defined(BOOST_HAS_INT128)
template<class T> void test()
{
using boost::endian::endian_reverse;
using boost::endian::endian_reverse_inplace;
{
T t1 = test_value<T>::v1;
T t2 = endian_reverse( t1 );
BOOST_TEST_EQ( t2, test_value<T>::w1 );
T t3 = endian_reverse( t2 );
BOOST_TEST_EQ( t3, t1 );
T t4 = t1;
endian_reverse_inplace( t4 );
BOOST_TEST_EQ( t4, test_value<T>::w1 );
endian_reverse_inplace( t4 );
BOOST_TEST_EQ( t4, t1 );
}
{
T t1 = test_value<T>::v2;
T t2 = endian_reverse( t1 );
BOOST_TEST_EQ( t2, test_value<T>::w2 );
T t3 = endian_reverse( t2 );
BOOST_TEST_EQ( t3, t1 );
T t4 = t1;
endian_reverse_inplace( t4 );
BOOST_TEST_EQ( t4, test_value<T>::w2 );
endian_reverse_inplace( t4 );
BOOST_TEST_EQ( t4, t1 );
}
}
template<class T> void test_np()
{
using boost::endian::endian_reverse;
using boost::endian::endian_reverse_inplace;
{
T t1 = test_value<T>::v1;
T t2 = endian_reverse( t1 );
BOOST_TEST( t2 == test_value<T>::w1 );
T t3 = endian_reverse( t2 );
BOOST_TEST( t3 == t1 );
T t4 = t1;
endian_reverse_inplace( t4 );
BOOST_TEST( t4 == test_value<T>::w1 );
endian_reverse_inplace( t4 );
BOOST_TEST( t4 == t1 );
}
{
T t1 = test_value<T>::v2;
T t2 = endian_reverse( t1 );
BOOST_TEST( t2 == test_value<T>::w2 );
T t3 = endian_reverse( t2 );
BOOST_TEST( t3 == t1 );
T t4 = t1;
endian_reverse_inplace( t4 );
BOOST_TEST( t4 == test_value<T>::w2 );
endian_reverse_inplace( t4 );
BOOST_TEST( t4 == t1 );
}
}
int main()
{
test<boost::int8_t>();
test<boost::uint8_t>();
test<boost::int16_t>();
test<boost::uint16_t>();
test<boost::int32_t>();
test<boost::uint32_t>();
test<boost::int64_t>();
test<boost::uint64_t>();
test<char>();
test<unsigned char>();
test<signed char>();
test<short>();
test<unsigned short>();
test<int>();
test<unsigned int>();
test<long>();
test<unsigned long>();
test<long long>();
test<unsigned long long>();
#if !defined(BOOST_NO_CXX11_CHAR16_T)
test<char16_t>();
#endif
#if !defined(BOOST_NO_CXX11_CHAR32_T)
test<char32_t>();
#endif
#if defined(BOOST_HAS_INT128)
test_np<boost::int128_type>();
test_np<boost::uint128_type>();
#endif
return boost::report_errors();
}

View File

@@ -0,0 +1,39 @@
// Copyright 2019, 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/cstdint.hpp>
namespace N
{
struct X
{
boost::uint32_t m;
};
template<class T> typename boost::enable_if_<boost::is_same<T, X>::value, T>::type endian_reverse( T x )
{
using boost::endian::endian_reverse;
X r = { endian_reverse( x.m ) };
return r;
}
} // namespace N
int main()
{
using namespace boost::endian;
N::X x1 = { 0x01020304 };
N::X x2 = endian_reverse( x1 );
BOOST_TEST_EQ( x2.m, 0x04030201 );
return boost::report_errors();
}

View File

@@ -0,0 +1,83 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cstddef>
template<class T> void test_reverse( T x )
{
using boost::endian::endian_reverse;
T x2( x );
x2 = endian_reverse( endian_reverse( x2 ) );
BOOST_TEST( x == x2 );
x2 = boost::endian::native_to_little( boost::endian::little_to_native( x2 ) );
BOOST_TEST( x == x2 );
x2 = boost::endian::native_to_big( boost::endian::big_to_native( x2 ) );
BOOST_TEST( x == x2 );
}
template<class T> void test_reverse_inplace( T x )
{
using boost::endian::endian_reverse_inplace;
T x2( x );
endian_reverse_inplace( x2 );
endian_reverse_inplace( x2 );
BOOST_TEST( x == x2 );
boost::endian::native_to_little_inplace( x2 );
boost::endian::little_to_native_inplace( x2 );
BOOST_TEST( x == x2 );
boost::endian::native_to_big_inplace( x2 );
boost::endian::big_to_native_inplace( x2 );
BOOST_TEST( x == x2 );
}
enum E1 { e1 };
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
enum E2: long { e2 };
enum class E3 { e3 };
enum class E4: long { e4 };
#endif
int main()
{
test_reverse( 1 );
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
test_reverse( E3::e3 );
test_reverse( E4::e4 );
#endif
test_reverse_inplace( 1 );
test_reverse_inplace( true );
test_reverse_inplace( 1.0f );
test_reverse_inplace( 1.0 );
test_reverse_inplace( e1 );
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
test_reverse_inplace( e2 );
test_reverse_inplace( E3::e3 );
test_reverse_inplace( E4::e4 );
#endif
return boost::report_errors();
}

View File

@@ -0,0 +1,74 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cstddef>
template<class T> void test_reverse_inplace( T x )
{
using boost::endian::endian_reverse_inplace;
T x2( x );
endian_reverse_inplace( x2 );
endian_reverse_inplace( x2 );
BOOST_TEST( x == x2 );
boost::endian::native_to_little_inplace( x2 );
boost::endian::little_to_native_inplace( x2 );
BOOST_TEST( x == x2 );
boost::endian::native_to_big_inplace( x2 );
boost::endian::big_to_native_inplace( x2 );
BOOST_TEST( x == x2 );
}
struct X
{
int v1_;
int v2_;
};
inline bool operator==( X const& x1, X const& x2 )
{
return x1.v1_ == x2.v1_ && x1.v2_ == x2.v2_;
}
inline void endian_reverse_inplace( X & x )
{
using boost::endian::endian_reverse_inplace;
endian_reverse_inplace( x.v1_ );
endian_reverse_inplace( x.v2_ );
}
struct Y
{
X x1_;
X x2_[ 2 ];
};
inline bool operator==( Y const& y1, Y const& y2 )
{
return y1.x1_ == y2.x1_ && y1.x2_[0] == y2.x2_[0] && y1.x2_[1] == y2.x2_[1];
}
inline void endian_reverse_inplace( Y & y )
{
using boost::endian::endian_reverse_inplace;
endian_reverse_inplace( y.x1_ );
endian_reverse_inplace( y.x2_ );
}
int main()
{
Y y = { { 1, 2 }, { { 3, 4 }, { 5, 6 } } };
test_reverse_inplace( y );
return boost::report_errors();
}

View File

@@ -0,0 +1,30 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <cstddef>
int main()
{
int v[] = { 1, 2 };
boost::endian::endian_reverse_inplace( v );
boost::endian::endian_reverse_inplace( v );
BOOST_TEST_EQ( v[0], 1 );
BOOST_TEST_EQ( v[1], 2 );
boost::endian::native_to_little_inplace( v );
boost::endian::little_to_native_inplace( v );
BOOST_TEST_EQ( v[0], 1 );
BOOST_TEST_EQ( v[1], 2 );
boost::endian::native_to_big_inplace( v );
boost::endian::big_to_native_inplace( v );
BOOST_TEST_EQ( v[0], 1 );
BOOST_TEST_EQ( v[1], 2 );
return boost::report_errors();
}

View File

@@ -0,0 +1,310 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
#include <ostream>
#include <iomanip>
class byte_span
{
private:
unsigned char const * p_;
std::size_t n_;
public:
byte_span( unsigned char const * p, std::size_t n ): p_( p ), n_( n )
{
}
template<std::size_t N> explicit byte_span( unsigned char const (&a)[ N ] ): p_( a ), n_( N )
{
}
bool operator==( byte_span const& r ) const
{
if( n_ != r.n_ ) return false;
for( std::size_t i = 0; i < n_; ++i )
{
if( p_[ i ] != r.p_[ i ] ) return false;
}
return true;
}
friend std::ostream& operator<<( std::ostream& os, byte_span s )
{
if( s.n_ == 0 ) return os;
os << std::hex << std::setfill( '0' ) << std::uppercase;
os << std::setw( 2 ) << +s.p_[ 0 ];
for( std::size_t i = 1; i < s.n_; ++i )
{
os << ':' << std::setw( 2 ) << +s.p_[ i ];
}
os << std::dec << std::setfill( ' ' ) << std::nouppercase;;
return os;
}
};
template<class T> void test_1()
{
{
unsigned char v[] = { 0xAA, 0xAA };
boost::endian::endian_store<T, 1, boost::endian::order::little>( v, 0x01 );
unsigned char w[] = { 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA };
boost::endian::endian_store<T, 1, boost::endian::order::big>( v, 0x01 );
unsigned char w[] = { 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_2()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 2, boost::endian::order::little>( v, 0x0102 );
unsigned char w[] = { 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 2, boost::endian::order::big>( v, 0x0102 );
unsigned char w[] = { 0x01, 0x02, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_3()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 3, boost::endian::order::little>( v, 0x010203 );
unsigned char w[] = { 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 3, boost::endian::order::big>( v, 0x010203 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_4()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 4, boost::endian::order::little>( v, 0x01020304 );
unsigned char w[] = { 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 4, boost::endian::order::big>( v, 0x01020304 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0x04, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_5()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 5, boost::endian::order::little>( v, 0x0102030405 );
unsigned char w[] = { 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 5, boost::endian::order::big>( v, 0x0102030405 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_6()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 6, boost::endian::order::little>( v, 0x010203040506 );
unsigned char w[] = { 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 6, boost::endian::order::big>( v, 0x010203040506 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_7()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 7, boost::endian::order::little>( v, 0x01020304050607 );
unsigned char w[] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 7, boost::endian::order::big>( v, 0x01020304050607 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
template<class T> void test_8()
{
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 8, boost::endian::order::little>( v, 0x0102030405060708 );
unsigned char w[] = { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
boost::endian::endian_store<T, 8, boost::endian::order::big>( v, 0x0102030405060708 );
unsigned char w[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w ) );
}
}
int main()
{
// 1
test_1<boost::int8_t>();
test_1<boost::uint8_t>();
test_1<boost::int16_t>();
test_1<boost::uint16_t>();
test_1<boost::int32_t>();
test_1<boost::uint32_t>();
test_1<boost::int64_t>();
test_1<boost::uint64_t>();
// 2
test_2<boost::int16_t>();
test_2<boost::uint16_t>();
test_2<boost::int32_t>();
test_2<boost::uint32_t>();
test_2<boost::int64_t>();
test_2<boost::uint64_t>();
// 3
test_3<boost::int32_t>();
test_3<boost::uint32_t>();
test_3<boost::int64_t>();
test_3<boost::uint64_t>();
// 4
test_4<boost::int32_t>();
test_4<boost::uint32_t>();
test_4<boost::int64_t>();
test_4<boost::uint64_t>();
// 5
test_5<boost::int64_t>();
test_5<boost::uint64_t>();
// 6
test_6<boost::int64_t>();
test_6<boost::uint64_t>();
// 7
test_7<boost::int64_t>();
test_7<boost::uint64_t>();
// 8
test_8<boost::int64_t>();
test_8<boost::uint64_t>();
return boost::report_errors();
}

View File

@@ -0,0 +1,852 @@
// endian_test.cpp ---------------------------------------------------------//
// Copyright Beman Dawes 1999-2008
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See library home page at http://www.boost.org/libs/endian
//----------------------------------------------------------------------------//
// This test probes for correct endianness, size, and value.
// See endian_operations_test for tests of operator correctness and interaction
// between operand types.
//----------------------------------------------------------------------------//
#include <boost/endian/detail/disable_warnings.hpp>
#include <boost/endian/arithmetic.hpp>
#include <boost/cstdint.hpp>
#include <iostream>
#include <limits>
#include <climits>
#include <cstdlib> // for atoi(), exit()
#include <cstring> // for memcmp()
#if defined(_MSC_VER)
# pragma warning(disable: 4127) // conditional expression is constant
#endif
using namespace std; // Not the best programming practice, but I
using namespace boost; // want to verify this combination of using
using namespace boost::endian; // namespaces works. See endian_operations_test
// // for tests that don't do "using namespace".
#define VERIFY(predicate) verify( predicate, __LINE__ )
#define VERIFY_SIZE(actual, expected) verify_size( actual, expected, __LINE__ )
#define VERIFY_VALUE_AND_OPS(endian_t,expected_t,expected) verify_value_and_ops<endian_t, expected_t>( expected, __LINE__ )
#define VERIFY_BIG_REPRESENTATION(t) verify_representation<t>( true, __LINE__ )
#define VERIFY_LITTLE_REPRESENTATION(t) verify_representation<t>( false, __LINE__ )
#define VERIFY_NATIVE_REPRESENTATION(t) verify_native_representation<t>( __LINE__ )
namespace
{
int err_count;
void verify( bool x, int line )
{
if ( x ) return;
++err_count;
cout << "Error: verify failed on line " << line << endl;
}
void verify_size( size_t actual, size_t expected, int line )
{
if ( actual == expected ) return;
++err_count;
cout << "Error: verify size failed on line " << line << endl;
cout << " A structure with an expected sizeof() " << expected
<< " had an actual sizeof() " << actual
<< "\n This will cause uses of endian types to fail\n";
}
template <class Endian, class Base>
void verify_value_and_ops( const Base & expected, int line )
{
Endian v( expected );
verify( v == expected, line );
Endian v2;
v2.operator=( expected );
verify( v2 == expected, line );
++v; // verify integer_cover_operators being applied to this type -
// will fail to compile if no endian<> specialization is present
Endian v3( static_cast<Base>( 1 ) );
Endian x(static_cast<typename Endian::value_type>(v2+v3));
if ( x == x ) // silence warning
return;
}
const char * big_rep = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0";
const char * little_rep = "\xF0\xDE\xBC\x9A\x78\x56\x34\x12";
template <class Endian>
void verify_representation( bool is_big, int line )
{
int silence = 0;
Endian x ( static_cast<typename Endian::value_type>
(0x123456789abcdef0LL + silence) ); // will truncate
if ( is_big )
verify( memcmp( &x,
reinterpret_cast<const char*>(big_rep)+8-sizeof(Endian),
sizeof(Endian) ) == 0, line );
else
verify( memcmp( &x, little_rep, sizeof(Endian) ) == 0, line );
}
template <class Endian>
inline void verify_native_representation( int line )
{
verify_representation<Endian>( order::native == order::big, line );
}
// detect_order -----------------------------------------------------//
void detect_order()
{
union View
{
long long i;
unsigned char c[8];
};
View v = { 0x0102030405060708LL }; // initialize v.i
if ( memcmp( v.c, "\x8\7\6\5\4\3\2\1", 8) == 0 )
{
cout << "This machine is little-endian.\n";
if( order::native != order::little )
{
cout << "yet boost::endian::order::native does not equal boost::endian::order::little.\n"
"The Boost Endian library must be revised to work correctly on this system.\n"
"Please report this problem to the Boost mailing list.\n";
exit(1);
}
}
else if ( memcmp( v.c, "\1\2\3\4\5\6\7\x8", 8) == 0 )
{
cout << "This machine is big-endian.\n";
if( order::native != order::big )
{
cout << "yet boost::endian::order::native does not equal boost::endian::order::big.\n"
"The Boost Endian library must be revised to work correctly on this system.\n"
"Please report this problem to the Boost mailing list.\n";
exit(1);
}
}
else
{
cout << "This machine is neither strict big-endian nor strict little-endian\n"
"The Boost Endian library must be revised to work correctly on this system.\n"
"Please report this problem to the Boost mailing list.\n";
exit(1);
}
cout << "That should not matter and is presented for your information only.\n";
} // detect_order
// check_data ------------------------------------------------------------//
void check_data()
{
big_int8_t big_8;
big_int16_t big_16;
big_int24_t big_24;
big_int32_t big_32;
big_int40_t big_40;
big_int48_t big_48;
big_int56_t big_56;
big_int64_t big_64;
big_uint8_t big_u8;
big_uint16_t big_u16;
big_uint24_t big_u24;
big_uint32_t big_u32;
big_uint40_t big_u40;
big_uint48_t big_u48;
big_uint56_t big_u56;
big_uint64_t big_u64;
little_int8_t little_8;
little_int16_t little_16;
little_int24_t little_24;
little_int32_t little_32;
little_int40_t little_40;
little_int48_t little_48;
little_int56_t little_56;
little_int64_t little_64;
little_uint8_t little_u8;
little_uint16_t little_u16;
little_uint24_t little_u24;
little_uint32_t little_u32;
little_uint40_t little_u40;
little_uint48_t little_u48;
little_uint56_t little_u56;
little_uint64_t little_u64;
native_int8_t native_8;
native_int16_t native_16;
native_int24_t native_24;
native_int32_t native_32;
native_int40_t native_40;
native_int48_t native_48;
native_int56_t native_56;
native_int64_t native_64;
native_uint8_t native_u8;
native_uint16_t native_u16;
native_uint24_t native_u24;
native_uint32_t native_u32;
native_uint40_t native_u40;
native_uint48_t native_u48;
native_uint56_t native_u56;
native_uint64_t native_u64;
big_int16_at big_align_int16;
big_int32_at big_align_int32;
big_int64_at big_align_int64;
big_uint16_at big_align_uint16;
big_uint32_at big_align_uint32;
big_uint64_at big_align_uint64;
little_int16_at little_align_int16;
little_int32_at little_align_int32;
little_int64_at little_align_int64;
little_uint16_at little_align_uint16;
little_uint32_at little_align_uint32;
little_uint64_at little_align_uint64;
VERIFY(big_8.data() == reinterpret_cast<const unsigned char *>(&big_8));
VERIFY(big_16.data() == reinterpret_cast<const unsigned char *>(&big_16));
VERIFY(big_24.data() == reinterpret_cast<const unsigned char *>(&big_24));
VERIFY(big_32.data() == reinterpret_cast<const unsigned char *>(&big_32));
VERIFY(big_40.data() == reinterpret_cast<const unsigned char *>(&big_40));
VERIFY(big_48.data() == reinterpret_cast<const unsigned char *>(&big_48));
VERIFY(big_56.data() == reinterpret_cast<const unsigned char *>(&big_56));
VERIFY(big_64.data() == reinterpret_cast<const unsigned char *>(&big_64));
VERIFY(big_u8.data() == reinterpret_cast<const unsigned char *>(&big_u8));
VERIFY(big_u16.data() == reinterpret_cast<const unsigned char *>(&big_u16));
VERIFY(big_u24.data() == reinterpret_cast<const unsigned char *>(&big_u24));
VERIFY(big_u32.data() == reinterpret_cast<const unsigned char *>(&big_u32));
VERIFY(big_u40.data() == reinterpret_cast<const unsigned char *>(&big_u40));
VERIFY(big_u48.data() == reinterpret_cast<const unsigned char *>(&big_u48));
VERIFY(big_u56.data() == reinterpret_cast<const unsigned char *>(&big_u56));
VERIFY(big_u64.data() == reinterpret_cast<const unsigned char *>(&big_u64));
VERIFY(little_8.data() == reinterpret_cast<const unsigned char *>(&little_8));
VERIFY(little_16.data() == reinterpret_cast<const unsigned char *>(&little_16));
VERIFY(little_24.data() == reinterpret_cast<const unsigned char *>(&little_24));
VERIFY(little_32.data() == reinterpret_cast<const unsigned char *>(&little_32));
VERIFY(little_40.data() == reinterpret_cast<const unsigned char *>(&little_40));
VERIFY(little_48.data() == reinterpret_cast<const unsigned char *>(&little_48));
VERIFY(little_56.data() == reinterpret_cast<const unsigned char *>(&little_56));
VERIFY(little_64.data() == reinterpret_cast<const unsigned char *>(&little_64));
VERIFY(little_u8.data() == reinterpret_cast<const unsigned char *>(&little_u8));
VERIFY(little_u16.data() == reinterpret_cast<const unsigned char *>(&little_u16));
VERIFY(little_u24.data() == reinterpret_cast<const unsigned char *>(&little_u24));
VERIFY(little_u32.data() == reinterpret_cast<const unsigned char *>(&little_u32));
VERIFY(little_u40.data() == reinterpret_cast<const unsigned char *>(&little_u40));
VERIFY(little_u48.data() == reinterpret_cast<const unsigned char *>(&little_u48));
VERIFY(little_u56.data() == reinterpret_cast<const unsigned char *>(&little_u56));
VERIFY(little_u64.data() == reinterpret_cast<const unsigned char *>(&little_u64));
VERIFY(native_8.data() == reinterpret_cast<const unsigned char *>(&native_8));
VERIFY(native_16.data() == reinterpret_cast<const unsigned char *>(&native_16));
VERIFY(native_24.data() == reinterpret_cast<const unsigned char *>(&native_24));
VERIFY(native_32.data() == reinterpret_cast<const unsigned char *>(&native_32));
VERIFY(native_40.data() == reinterpret_cast<const unsigned char *>(&native_40));
VERIFY(native_48.data() == reinterpret_cast<const unsigned char *>(&native_48));
VERIFY(native_56.data() == reinterpret_cast<const unsigned char *>(&native_56));
VERIFY(native_64.data() == reinterpret_cast<const unsigned char *>(&native_64));
VERIFY(native_u8.data() == reinterpret_cast<const unsigned char *>(&native_u8));
VERIFY(native_u16.data() == reinterpret_cast<const unsigned char *>(&native_u16));
VERIFY(native_u24.data() == reinterpret_cast<const unsigned char *>(&native_u24));
VERIFY(native_u32.data() == reinterpret_cast<const unsigned char *>(&native_u32));
VERIFY(native_u40.data() == reinterpret_cast<const unsigned char *>(&native_u40));
VERIFY(native_u48.data() == reinterpret_cast<const unsigned char *>(&native_u48));
VERIFY(native_u56.data() == reinterpret_cast<const unsigned char *>(&native_u56));
VERIFY(native_u64.data() == reinterpret_cast<const unsigned char *>(&native_u64));
VERIFY(big_align_int16.data() == reinterpret_cast<const unsigned char *>(&big_align_int16));
VERIFY(big_align_int32.data() == reinterpret_cast<const unsigned char *>(&big_align_int32));
VERIFY(big_align_int64.data() == reinterpret_cast<const unsigned char *>(&big_align_int64));
VERIFY(big_align_uint16.data() == reinterpret_cast<const unsigned char *>(&big_align_uint16));
VERIFY(big_align_uint32.data() == reinterpret_cast<const unsigned char *>(&big_align_uint32));
VERIFY(big_align_uint64.data() == reinterpret_cast<const unsigned char *>(&big_align_uint64));
VERIFY(little_align_int16.data() == reinterpret_cast<const unsigned char *>(&little_align_int16));
VERIFY(little_align_int32.data() == reinterpret_cast<const unsigned char *>(&little_align_int32));
VERIFY(little_align_int64.data() == reinterpret_cast<const unsigned char *>(&little_align_int64));
VERIFY(little_align_uint16.data() == reinterpret_cast<const unsigned char *>(&little_align_uint16));
VERIFY(little_align_uint32.data() == reinterpret_cast<const unsigned char *>(&little_align_uint32));
VERIFY(little_align_uint64.data() == reinterpret_cast<const unsigned char *>(&little_align_uint64));
}
// check_size ------------------------------------------------------------//
void check_size()
{
VERIFY( numeric_limits<signed char>::digits == 7 );
VERIFY( numeric_limits<unsigned char>::digits == 8 );
VERIFY_SIZE( sizeof( big_int8_t ), 1 );
VERIFY_SIZE( sizeof( big_int16_t ), 2 );
VERIFY_SIZE( sizeof( big_int24_t ), 3 );
VERIFY_SIZE( sizeof( big_int32_t ), 4 );
VERIFY_SIZE( sizeof( big_int40_t ), 5 );
VERIFY_SIZE( sizeof( big_int48_t ), 6 );
VERIFY_SIZE( sizeof( big_int56_t ), 7 );
VERIFY_SIZE( sizeof( big_int64_t ), 8 );
VERIFY_SIZE( sizeof( big_uint8_t ), 1 );
VERIFY_SIZE( sizeof( big_uint16_t ), 2 );
VERIFY_SIZE( sizeof( big_uint24_t ), 3 );
VERIFY_SIZE( sizeof( big_uint32_t ), 4 );
VERIFY_SIZE( sizeof( big_uint40_t ), 5 );
VERIFY_SIZE( sizeof( big_uint48_t ), 6 );
VERIFY_SIZE( sizeof( big_uint56_t ), 7 );
VERIFY_SIZE( sizeof( big_uint64_t ), 8 );
VERIFY_SIZE( sizeof( little_int8_t ), 1 );
VERIFY_SIZE( sizeof( little_int16_t ), 2 );
VERIFY_SIZE( sizeof( little_int24_t ), 3 );
VERIFY_SIZE( sizeof( little_int32_t ), 4 );
VERIFY_SIZE( sizeof( little_int40_t ), 5 );
VERIFY_SIZE( sizeof( little_int48_t ), 6 );
VERIFY_SIZE( sizeof( little_int56_t ), 7 );
VERIFY_SIZE( sizeof( little_int64_t ), 8 );
VERIFY_SIZE( sizeof( little_uint8_t ), 1 );
VERIFY_SIZE( sizeof( little_uint16_t ), 2 );
VERIFY_SIZE( sizeof( little_uint24_t ), 3 );
VERIFY_SIZE( sizeof( little_uint32_t ), 4 );
VERIFY_SIZE( sizeof( little_uint40_t ), 5 );
VERIFY_SIZE( sizeof( little_uint48_t ), 6 );
VERIFY_SIZE( sizeof( little_uint56_t ), 7 );
VERIFY_SIZE( sizeof( little_uint64_t ), 8 );
VERIFY_SIZE( sizeof( native_int8_t ), 1 );
VERIFY_SIZE( sizeof( native_int16_t ), 2 );
VERIFY_SIZE( sizeof( native_int24_t ), 3 );
VERIFY_SIZE( sizeof( native_int32_t ), 4 );
VERIFY_SIZE( sizeof( native_int40_t ), 5 );
VERIFY_SIZE( sizeof( native_int48_t ), 6 );
VERIFY_SIZE( sizeof( native_int56_t ), 7 );
VERIFY_SIZE( sizeof( native_int64_t ), 8 );
VERIFY_SIZE( sizeof( native_uint8_t ), 1 );
VERIFY_SIZE( sizeof( native_uint16_t ), 2 );
VERIFY_SIZE( sizeof( native_uint24_t ), 3 );
VERIFY_SIZE( sizeof( native_uint32_t ), 4 );
VERIFY_SIZE( sizeof( native_uint40_t ), 5 );
VERIFY_SIZE( sizeof( native_uint48_t ), 6 );
VERIFY_SIZE( sizeof( native_uint56_t ), 7 );
VERIFY_SIZE( sizeof( native_uint64_t ), 8 );
VERIFY_SIZE(sizeof(big_int8_at), 1);
VERIFY_SIZE(sizeof(big_int16_at), 2);
VERIFY_SIZE( sizeof( big_int32_at ), 4 );
VERIFY_SIZE( sizeof( big_int64_at ), 8 );
VERIFY_SIZE(sizeof(big_uint8_at), 1);
VERIFY_SIZE(sizeof(big_uint16_at), 2);
VERIFY_SIZE( sizeof( big_uint32_at ), 4 );
VERIFY_SIZE( sizeof( big_uint64_at ), 8 );
VERIFY_SIZE(sizeof(little_int8_at), 1);
VERIFY_SIZE(sizeof(little_int16_at), 2);
VERIFY_SIZE( sizeof( little_int32_at ), 4 );
VERIFY_SIZE( sizeof( little_int64_at ), 8 );
VERIFY_SIZE(sizeof(little_uint8_at), 1);
VERIFY_SIZE(sizeof(little_uint16_at), 2);
VERIFY_SIZE( sizeof( little_uint32_at ), 4 );
VERIFY_SIZE( sizeof( little_uint64_at ), 8 );
} // check_size
// check_alignment -------------------------------------------------------//
void check_alignment()
{
// structs with offsets % 2 == 1 for type of size > 1 to ensure no alignment
// bytes added for any size > 1
struct big_struct
{
big_int8_t v0;
big_int16_t v1;
big_int24_t v3;
char v6;
big_int32_t v7;
big_int40_t v11;
char v16;
big_int48_t v17;
big_int56_t v23;
char v30;
big_int64_t v31;
};
struct big_u_struct
{
big_uint8_t v0;
big_uint16_t v1;
big_uint24_t v3;
char v6;
big_uint32_t v7;
big_uint40_t v11;
char v16;
big_uint48_t v17;
big_uint56_t v23;
char v30;
big_uint64_t v31;
};
struct little_struct
{
little_int8_t v0;
little_int16_t v1;
little_int24_t v3;
char v6;
little_int32_t v7;
little_int40_t v11;
char v16;
little_int48_t v17;
little_int56_t v23;
char v30;
little_int64_t v31;
};
struct little_u_struct
{
little_uint8_t v0;
little_uint16_t v1;
little_uint24_t v3;
char v6;
little_uint32_t v7;
little_uint40_t v11;
char v16;
little_uint48_t v17;
little_uint56_t v23;
char v30;
little_uint64_t v31;
};
struct native_struct
{
native_int8_t v0;
native_int16_t v1;
native_int24_t v3;
char v6;
native_int32_t v7;
native_int40_t v11;
char v16;
native_int48_t v17;
native_int56_t v23;
char v30;
native_int64_t v31;
};
struct native_u_struct
{
native_uint8_t v0;
native_uint16_t v1;
native_uint24_t v3;
char v6;
native_uint32_t v7;
native_uint40_t v11;
char v16;
native_uint48_t v17;
native_uint56_t v23;
char v30;
native_uint64_t v31;
};
// aligned test cases
struct big_aligned_struct
{
big_int16_at v0;
big_int32_at v1;
char v3;
// on a 32-bit system, the padding here may be 3 rather than 7 bytes
big_int64_at v4;
};
struct little_aligned_struct
{
little_int16_at v0;
little_int32_at v1;
char v3;
// on a 32-bit system, the padding here may be 3 rather than 7 bytes
little_int64_at v4;
};
int saved_err_count = err_count;
VERIFY_SIZE( sizeof(big_struct), 39 );
VERIFY_SIZE( sizeof(big_u_struct), 39 );
VERIFY_SIZE( sizeof(little_struct), 39 );
VERIFY_SIZE( sizeof(little_u_struct), 39 );
VERIFY_SIZE( sizeof(native_struct), 39 );
VERIFY_SIZE( sizeof(native_u_struct), 39 );
VERIFY( sizeof(big_aligned_struct) <= 24 );
VERIFY( sizeof(little_aligned_struct) <= 24 );
if ( saved_err_count == err_count )
{
cout <<
"Size and alignment for structures of endian types are as expected.\n";
}
} // check_alignment
// check_representation_and_range_and_ops --------------------------------//
void check_representation_and_range_and_ops()
{
// unaligned integer types
VERIFY_BIG_REPRESENTATION( big_int8_t );
VERIFY_VALUE_AND_OPS( big_int8_t, int_least8_t, 0x7e );
VERIFY_VALUE_AND_OPS( big_int8_t, int_least8_t, -0x80 );
VERIFY_BIG_REPRESENTATION( big_int16_t );
VERIFY_VALUE_AND_OPS( big_int16_t, int_least16_t, 0x7ffe );
VERIFY_VALUE_AND_OPS( big_int16_t, int_least16_t, -0x8000 );
VERIFY_BIG_REPRESENTATION( big_int24_t );
VERIFY_VALUE_AND_OPS( big_int24_t, int_least32_t, 0x7ffffe );
VERIFY_VALUE_AND_OPS( big_int24_t, int_least32_t, -0x800000 );
VERIFY_BIG_REPRESENTATION( big_int32_t );
VERIFY_VALUE_AND_OPS( big_int32_t, int_least32_t, 0x7ffffffe );
VERIFY_VALUE_AND_OPS( big_int32_t, int_least32_t, -0x7fffffff-1 );
VERIFY_BIG_REPRESENTATION( big_int40_t );
VERIFY_VALUE_AND_OPS( big_int40_t, int_least64_t, 0x7ffffffffeLL );
VERIFY_VALUE_AND_OPS( big_int40_t, int_least64_t, -0x8000000000LL );
VERIFY_BIG_REPRESENTATION( big_int48_t );
VERIFY_VALUE_AND_OPS( big_int48_t, int_least64_t, 0x7ffffffffffeLL );
VERIFY_VALUE_AND_OPS( big_int48_t, int_least64_t, -0x800000000000LL );
VERIFY_BIG_REPRESENTATION( big_int56_t );
VERIFY_VALUE_AND_OPS( big_int56_t, int_least64_t, 0x7ffffffffffffeLL );
VERIFY_VALUE_AND_OPS( big_int56_t, int_least64_t, -0x80000000000000LL );
VERIFY_BIG_REPRESENTATION( big_int64_t );
VERIFY_VALUE_AND_OPS( big_int64_t, int_least64_t, 0x7ffffffffffffffeLL );
VERIFY_VALUE_AND_OPS( big_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 );
VERIFY_BIG_REPRESENTATION( big_uint8_t );
VERIFY_VALUE_AND_OPS( big_uint8_t, uint_least8_t, 0xff );
VERIFY_BIG_REPRESENTATION( big_uint16_t );
VERIFY_VALUE_AND_OPS( big_uint16_t, uint_least16_t, 0xffff );
VERIFY_BIG_REPRESENTATION( big_uint24_t );
VERIFY_VALUE_AND_OPS( big_uint24_t, uint_least32_t, 0xffffff );
VERIFY_BIG_REPRESENTATION( big_uint32_t );
VERIFY_VALUE_AND_OPS( big_uint32_t, uint_least32_t, 0xffffffff );
VERIFY_BIG_REPRESENTATION( big_uint40_t );
VERIFY_VALUE_AND_OPS( big_uint40_t, uint_least64_t, 0xffffffffffLL );
VERIFY_BIG_REPRESENTATION( big_uint48_t );
VERIFY_VALUE_AND_OPS( big_uint48_t, uint_least64_t, 0xffffffffffffLL );
VERIFY_BIG_REPRESENTATION( big_uint56_t );
VERIFY_VALUE_AND_OPS( big_uint56_t, uint_least64_t, 0xffffffffffffffLL );
VERIFY_BIG_REPRESENTATION( big_uint64_t );
VERIFY_VALUE_AND_OPS( big_uint64_t, uint_least64_t, 0xffffffffffffffffULL );
VERIFY_LITTLE_REPRESENTATION( little_int8_t );
VERIFY_VALUE_AND_OPS( little_int8_t, int_least8_t, 0x7e );
VERIFY_VALUE_AND_OPS( little_int8_t, int_least8_t, -0x80 );
VERIFY_LITTLE_REPRESENTATION( little_int16_t );
VERIFY_VALUE_AND_OPS( little_int16_t, int_least16_t, 0x7ffe );
VERIFY_VALUE_AND_OPS( little_int16_t, int_least16_t, -0x8000 );
VERIFY_LITTLE_REPRESENTATION( little_int24_t );
VERIFY_VALUE_AND_OPS( little_int24_t, int_least32_t, 0x7ffffe );
VERIFY_VALUE_AND_OPS( little_int24_t, int_least32_t, -0x800000 );
VERIFY_LITTLE_REPRESENTATION( little_int32_t );
VERIFY_VALUE_AND_OPS( little_int32_t, int_least32_t, 0x7ffffffe );
VERIFY_VALUE_AND_OPS( little_int32_t, int_least32_t, -0x7fffffff-1 );
VERIFY_LITTLE_REPRESENTATION( little_int40_t );
VERIFY_VALUE_AND_OPS( little_int40_t, int_least64_t, 0x7ffffffffeLL );
VERIFY_VALUE_AND_OPS( little_int40_t, int_least64_t, -0x8000000000LL );
VERIFY_LITTLE_REPRESENTATION( little_int48_t );
VERIFY_VALUE_AND_OPS( little_int48_t, int_least64_t, 0x7ffffffffffeLL );
VERIFY_VALUE_AND_OPS( little_int48_t, int_least64_t, -0x800000000000LL );
VERIFY_LITTLE_REPRESENTATION( little_int56_t );
VERIFY_VALUE_AND_OPS( little_int56_t, int_least64_t, 0x7ffffffffffffeLL );
VERIFY_VALUE_AND_OPS( little_int56_t, int_least64_t, -0x80000000000000LL );
VERIFY_LITTLE_REPRESENTATION( little_int64_t );
VERIFY_VALUE_AND_OPS( little_int64_t, int_least64_t, 0x7ffffffffffffffeLL );
VERIFY_VALUE_AND_OPS( little_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 );
VERIFY_LITTLE_REPRESENTATION( little_uint8_t );
VERIFY_VALUE_AND_OPS( little_uint8_t, uint_least8_t, 0xff );
VERIFY_LITTLE_REPRESENTATION( little_uint16_t );
VERIFY_VALUE_AND_OPS( little_uint16_t, uint_least16_t, 0xffff );
VERIFY_LITTLE_REPRESENTATION( little_uint24_t );
VERIFY_VALUE_AND_OPS( little_uint24_t, uint_least32_t, 0xffffff );
VERIFY_LITTLE_REPRESENTATION( little_uint32_t );
VERIFY_VALUE_AND_OPS( little_uint32_t, uint_least32_t, 0xffffffff );
VERIFY_LITTLE_REPRESENTATION( little_uint40_t );
VERIFY_VALUE_AND_OPS( little_uint40_t, uint_least64_t, 0xffffffffffLL );
VERIFY_LITTLE_REPRESENTATION( little_uint48_t );
VERIFY_VALUE_AND_OPS( little_uint48_t, uint_least64_t, 0xffffffffffffLL );
VERIFY_LITTLE_REPRESENTATION( little_uint56_t );
VERIFY_VALUE_AND_OPS( little_uint56_t, uint_least64_t, 0xffffffffffffffLL );
VERIFY_LITTLE_REPRESENTATION( little_uint64_t );
VERIFY_VALUE_AND_OPS( little_uint64_t, uint_least64_t, 0xffffffffffffffffULL );
VERIFY_NATIVE_REPRESENTATION( native_int8_t );
VERIFY_VALUE_AND_OPS( native_int8_t, int_least8_t, 0x7e );
VERIFY_VALUE_AND_OPS( native_int8_t, int_least8_t, -0x80 );
VERIFY_NATIVE_REPRESENTATION( native_int16_t );
VERIFY_VALUE_AND_OPS( native_int16_t, int_least16_t, 0x7ffe );
VERIFY_VALUE_AND_OPS( native_int16_t, int_least16_t, -0x8000 );
VERIFY_NATIVE_REPRESENTATION( native_int24_t );
VERIFY_VALUE_AND_OPS( native_int24_t, int_least32_t, 0x7ffffe );
VERIFY_VALUE_AND_OPS( native_int24_t, int_least32_t, -0x800000 );
VERIFY_NATIVE_REPRESENTATION( native_int32_t );
VERIFY_VALUE_AND_OPS( native_int32_t, int_least32_t, 0x7ffffffe );
VERIFY_VALUE_AND_OPS( native_int32_t, int_least32_t, -0x7fffffff-1 );
VERIFY_NATIVE_REPRESENTATION( native_int40_t );
VERIFY_VALUE_AND_OPS( native_int40_t, int_least64_t, 0x7ffffffffeLL );
VERIFY_VALUE_AND_OPS( native_int40_t, int_least64_t, -0x8000000000LL );
VERIFY_NATIVE_REPRESENTATION( native_int48_t );
VERIFY_VALUE_AND_OPS( native_int48_t, int_least64_t, 0x7ffffffffffeLL );
VERIFY_VALUE_AND_OPS( native_int48_t, int_least64_t, -0x800000000000LL );
VERIFY_NATIVE_REPRESENTATION( native_int56_t );
VERIFY_VALUE_AND_OPS( native_int56_t, int_least64_t, 0x7ffffffffffffeLL );
VERIFY_VALUE_AND_OPS( native_int56_t, int_least64_t, -0x80000000000000LL );
VERIFY_NATIVE_REPRESENTATION( native_int64_t );
VERIFY_VALUE_AND_OPS( native_int64_t, int_least64_t, 0x7ffffffffffffffeLL );
VERIFY_VALUE_AND_OPS( native_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 );
VERIFY_NATIVE_REPRESENTATION( native_uint8_t );
VERIFY_VALUE_AND_OPS( native_uint8_t, uint_least8_t, 0xff );
VERIFY_NATIVE_REPRESENTATION( native_uint16_t );
VERIFY_VALUE_AND_OPS( native_uint16_t, uint_least16_t, 0xffff );
VERIFY_NATIVE_REPRESENTATION( native_uint24_t );
VERIFY_VALUE_AND_OPS( native_uint24_t, uint_least32_t, 0xffffff );
VERIFY_NATIVE_REPRESENTATION( native_uint32_t );
VERIFY_VALUE_AND_OPS( native_uint32_t, uint_least32_t, 0xffffffff );
VERIFY_NATIVE_REPRESENTATION( native_uint40_t );
VERIFY_VALUE_AND_OPS( native_uint40_t, uint_least64_t, 0xffffffffffLL );
VERIFY_NATIVE_REPRESENTATION( native_uint48_t );
VERIFY_VALUE_AND_OPS( native_uint48_t, uint_least64_t, 0xffffffffffffLL );
VERIFY_NATIVE_REPRESENTATION( native_uint56_t );
VERIFY_VALUE_AND_OPS( native_uint56_t, uint_least64_t, 0xffffffffffffffLL );
VERIFY_NATIVE_REPRESENTATION( native_uint64_t );
VERIFY_VALUE_AND_OPS( native_uint64_t, uint_least64_t, 0xffffffffffffffffULL );
// aligned integer types
VERIFY_BIG_REPRESENTATION( big_int16_at );
VERIFY_VALUE_AND_OPS( big_int16_at, int_least16_t, 0x7ffe );
VERIFY_VALUE_AND_OPS( big_int16_at, int_least16_t, -0x8000 );
VERIFY_BIG_REPRESENTATION( big_int32_at );
VERIFY_VALUE_AND_OPS( big_int32_at, int_least32_t, 0x7ffffffe );
VERIFY_VALUE_AND_OPS( big_int32_at, int_least32_t, -0x7fffffff-1 );
VERIFY_BIG_REPRESENTATION( big_int64_at );
VERIFY_VALUE_AND_OPS( big_int64_at, int_least64_t, 0x7ffffffffffffffeLL );
VERIFY_VALUE_AND_OPS( big_int64_at, int_least64_t, -0x7fffffffffffffffLL-1 );
VERIFY_BIG_REPRESENTATION( big_uint16_at );
VERIFY_VALUE_AND_OPS( big_uint16_at, uint_least16_t, 0xffff );
VERIFY_BIG_REPRESENTATION( big_uint32_at );
VERIFY_VALUE_AND_OPS( big_uint32_at, uint_least32_t, 0xffffffff );
VERIFY_BIG_REPRESENTATION( big_uint64_at );
VERIFY_VALUE_AND_OPS( big_uint64_at, uint_least64_t, 0xffffffffffffffffULL );
VERIFY_LITTLE_REPRESENTATION( little_int16_at );
VERIFY_VALUE_AND_OPS( little_int16_at, int_least16_t, 0x7ffe );
VERIFY_VALUE_AND_OPS( little_int16_at, int_least16_t, -0x8000 );
VERIFY_LITTLE_REPRESENTATION( little_int32_at );
VERIFY_VALUE_AND_OPS( little_int32_at, int_least32_t, 0x7ffffffe );
VERIFY_VALUE_AND_OPS( little_int32_at, int_least32_t, -0x7fffffff-1 );
VERIFY_LITTLE_REPRESENTATION( little_int64_at );
VERIFY_VALUE_AND_OPS( little_int64_at, int_least64_t, 0x7ffffffffffffffeLL );
VERIFY_VALUE_AND_OPS( little_int64_at, int_least64_t, -0x7fffffffffffffffLL-1 );
VERIFY_LITTLE_REPRESENTATION( little_uint16_at );
VERIFY_VALUE_AND_OPS( little_uint16_at, uint_least16_t, 0xffff );
VERIFY_LITTLE_REPRESENTATION( little_uint32_at );
VERIFY_VALUE_AND_OPS( little_uint32_at, uint_least32_t, 0xffffffff );
VERIFY_LITTLE_REPRESENTATION( little_uint64_at );
VERIFY_VALUE_AND_OPS( little_uint64_at, uint_least64_t, 0xffffffffffffffffULL );
} // check_representation_and_range
/*
class MyInt
{
int32_t mx;
public:
MyInt(int32_t x = 0) : mx(x) {}
operator int32_t() const {return mx;}
//friend int32_t operator+(const MyInt& x) {return x;}
};
void check_udt()
{
typedef boost::endian::endian_arithmetic< order::big, MyInt, 32 > mybig_int32_ut;
mybig_int32_ut v(10);
cout << "+v is " << +v << endl;
v += 1;
cout << "v is " << +v << endl;
v -= 2;
cout << "v is " << +v << endl;
v *= 2;
cout << "v is " << +v << endl;
++v;
cout << "v is " << +v << endl;
--v;
cout << "v is " << +v << endl;
// cout << "v+v is " << +(v+v) << endl;
}
void check_udt_le()
{
typedef boost::endian::endian_arithmetic< order::little, MyInt, 32 > mylittle_int32_ut;
mylittle_int32_ut v(10);
cout << "+v is " << +v << endl;
v += 1;
cout << "v is " << +v << endl;
v -= 2;
cout << "v is " << +v << endl;
v *= 2;
cout << "v is " << +v << endl;
++v;
cout << "v is " << +v << endl;
--v;
cout << "v is " << +v << endl;
// cout << "v+v is " << +(v+v) << endl;
}
*/
long iterations = 10000;
template< class Endian >
Endian timing_test( const char * s)
{
cout << s << " timing test, " << iterations << " iterations: ";
// progress_timer t;
Endian v = 1;
for ( long i = 0; i < iterations; ++i )
{
v += 1;
v *= 3;
++v;
v *= i;
if ( i == 0 ) VERIFY_VALUE_AND_OPS( Endian, typename Endian::value_type, 21 );
}
return v;
}
} // unnamed namespace
// main ------------------------------------------------------------------------------//
int cpp_main( int argc, char * argv[] )
{
cout << "Usage: "
<< argv[0] << " [#],\n where # specifies iteration count\n"
" default iteration count is " << iterations << endl;
if ( argc > 1 )
iterations = atol( argv[1] );
if ( iterations < 1 ) iterations = 1;
detect_order();
check_size();
check_alignment();
check_representation_and_range_and_ops();
check_data();
//check_udt();
//check_udt_le();
//timing_test<big_int32_t> ( "big_int32_t" );
//timing_test<big_int32_at>( "big_int32_at" );
//timing_test<little_int32_t> ( "little_int32_t" );
//timing_test<little_int32_at>( "little_int32_at" );
cout << "\n" << err_count << " errors detected\nTest "
<< (err_count==0 ? "passed\n\n" : "failed\n\n");
return err_count ? 1 : 0;
} // main
int main( int argc, char* argv[] )
{
try
{
return cpp_main( argc, argv );
}
catch( std::exception const & x )
{
std::cout << "Exception: " << x.what() << std::endl;
return 1;
}
}

View File

@@ -0,0 +1,83 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/arithmetic.hpp>
#include <boost/endian/buffers.hpp>
#include <boost/core/lightweight_test.hpp>
template<class T> struct align
{
char _;
T v;
explicit align( typename T::value_type y ): _(), v( y )
{
}
};
template<class T> struct align2
{
char _;
T v;
};
template<class T, class U> void test_buffer( U const & y, bool aligned )
{
align<T> x( y );
BOOST_TEST_EQ( sizeof(x), aligned? sizeof( align2<U> ): 1 + sizeof(U) );
BOOST_TEST_EQ( x.v.value(), y );
}
template<class T, class U> void test_arithmetic( U const & y, bool aligned )
{
test_buffer<T>( y, aligned );
align<T> x( y );
BOOST_TEST_EQ( x.v + 7, y + 7 );
}
int main()
{
using namespace boost::endian;
// buffers
test_buffer<big_float32_buf_t>( 3.1416f, false );
test_buffer<big_float64_buf_t>( 3.14159, false );
test_buffer<little_float32_buf_t>( 3.1416f, false );
test_buffer<little_float64_buf_t>( 3.14159, false );
test_buffer<native_float32_buf_t>( 3.1416f, false );
test_buffer<native_float64_buf_t>( 3.14159, false );
test_buffer<big_float32_buf_at>( 3.1416f, true );
test_buffer<big_float64_buf_at>( 3.14159, true );
test_buffer<little_float32_buf_at>( 3.1416f, true );
test_buffer<little_float64_buf_at>( 3.14159, true );
// arithmetic
test_arithmetic<big_float32_t>( 3.1416f, false );
test_arithmetic<big_float64_t>( 3.14159, false );
test_arithmetic<little_float32_t>( 3.1416f, false );
test_arithmetic<little_float64_t>( 3.14159, false );
test_arithmetic<native_float32_t>( 3.1416f, false );
test_arithmetic<native_float64_t>( 3.14159, false );
test_arithmetic<big_float32_at>( 3.1416f, true );
test_arithmetic<big_float64_at>( 3.14159, true );
test_arithmetic<little_float32_at>( 3.1416f, true );
test_arithmetic<little_float64_at>( 3.14159, true );
return boost::report_errors();
}

View File

@@ -0,0 +1,35 @@
// Copyright Beman Dawes 2013
// Copyright 2018 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/detail/intrinsic.hpp>
#include <boost/core/lightweight_test.hpp>
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
int main()
{
std::cout << "BOOST_ENDIAN_INTRINSIC_MSG: " BOOST_ENDIAN_INTRINSIC_MSG << std::endl;
#ifndef BOOST_ENDIAN_NO_INTRINSICS
uint16 x2 = 0x1122U;
uint16 y2 = BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x2);
BOOST_TEST_EQ( y2, 0x2211U );
uint32 x4 = 0x11223344UL;
uint32 y4 = BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x4);
BOOST_TEST_EQ( y4, 0x44332211UL );
uint64 x8 = 0x1122334455667788U;
uint64 y8 = BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x8);
BOOST_TEST_EQ( y8, 0x8877665544332211ULL );
#endif
return boost::report_errors();
}

View File

@@ -0,0 +1,78 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/detail/is_scoped_enum.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <boost/config.hpp>
enum E1 {};
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
enum E2: long {};
enum class E3 {};
enum class E4: long {};
#endif
struct X
{
operator int() const { return 0; }
};
struct Y;
template<class T> void test_true()
{
using boost::endian::detail::is_scoped_enum;
BOOST_TEST_TRAIT_TRUE((is_scoped_enum<T>));
BOOST_TEST_TRAIT_TRUE((is_scoped_enum<T const>));
BOOST_TEST_TRAIT_TRUE((is_scoped_enum<T volatile>));
BOOST_TEST_TRAIT_TRUE((is_scoped_enum<T const volatile>));
}
template<class T> void test_false()
{
using boost::endian::detail::is_scoped_enum;
BOOST_TEST_TRAIT_FALSE((is_scoped_enum<T>));
BOOST_TEST_TRAIT_FALSE((is_scoped_enum<T const>));
BOOST_TEST_TRAIT_FALSE((is_scoped_enum<T volatile>));
BOOST_TEST_TRAIT_FALSE((is_scoped_enum<T const volatile>));
}
template<class T> void test_false_()
{
using boost::endian::detail::is_scoped_enum;
BOOST_TEST_NOT((is_scoped_enum<T>::value));
BOOST_TEST_NOT((is_scoped_enum<T const>::value));
BOOST_TEST_NOT((is_scoped_enum<T volatile>::value));
BOOST_TEST_NOT((is_scoped_enum<T const volatile>::value));
}
int main()
{
test_false<int>();
test_false<bool>();
test_false<X>();
test_false_<Y>();
test_false<void>();
test_false<int[]>();
test_false<int[1]>();
test_false<E1>();
#if !defined(BOOST_NO_CXX11_SCOPED_ENUMS)
test_false<E2>();
test_true<E3>();
test_true<E4>();
#endif
return boost::report_errors();
}

View File

@@ -0,0 +1,75 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
int main()
{
using namespace boost::endian;
unsigned char v[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8 };
// 16
BOOST_TEST_EQ( load_little_s16( v ), -3343 );
BOOST_TEST_EQ( load_little_u16( v ), 0xF2F1 );
BOOST_TEST_EQ( load_big_s16( v ), -3598 );
BOOST_TEST_EQ( load_big_u16( v ), 0xF1F2 );
// 24
BOOST_TEST_EQ( load_little_s24( v ), -789775 );
BOOST_TEST_EQ( load_little_u24( v ), 0xF3F2F1 );
BOOST_TEST_EQ( load_big_s24( v ), -920845 );
BOOST_TEST_EQ( load_big_u24( v ), 0xF1F2F3 );
// 32
BOOST_TEST_EQ( load_little_s32( v ), 0xF4F3F2F1 );
BOOST_TEST_EQ( load_little_u32( v ), 0xF4F3F2F1 );
BOOST_TEST_EQ( load_big_s32( v ), 0xF1F2F3F4 );
BOOST_TEST_EQ( load_big_u32( v ), 0xF1F2F3F4 );
// 40
BOOST_TEST_EQ( load_little_s40( v ), -43135012111 );
BOOST_TEST_EQ( load_little_u40( v ), 0xF5F4F3F2F1 );
BOOST_TEST_EQ( load_big_s40( v ), -60348435211 );
BOOST_TEST_EQ( load_big_u40( v ), 0xF1F2F3F4F5 );
// 48
BOOST_TEST_EQ( load_little_s48( v ), -9938739662095 );
BOOST_TEST_EQ( load_little_u48( v ), 0xF6F5F4F3F2F1 );
BOOST_TEST_EQ( load_big_s48( v ), -15449199413770 );
BOOST_TEST_EQ( load_big_u48( v ), 0xF1F2F3F4F5F6 );
// 56
BOOST_TEST_EQ( load_little_s56( v ), -2261738553347343 );
BOOST_TEST_EQ( load_little_u56( v ), 0xF7F6F5F4F3F2F1 );
BOOST_TEST_EQ( load_big_s56( v ), -3954995049924873 );
BOOST_TEST_EQ( load_big_u56( v ), 0xF1F2F3F4F5F6F7 );
// 64
BOOST_TEST_EQ( load_little_s64( v ), 0xF8F7F6F5F4F3F2F1 );
BOOST_TEST_EQ( load_little_u64( v ), 0xF8F7F6F5F4F3F2F1 );
BOOST_TEST_EQ( load_big_s64( v ), 0xF1F2F3F4F5F6F7F8 );
BOOST_TEST_EQ( load_big_u64( v ), 0xF1F2F3F4F5F6F7F8 );
return boost::report_errors();
}

View File

@@ -0,0 +1,315 @@
// loop_time_test.cpp ----------------------------------------------------------------//
// Copyright Beman Dawes 2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
//#define BOOST_ENDIAN_NO_INTRINSICS
#include <boost/endian/detail/disable_warnings.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/endian/arithmetic.hpp>
#include <boost/cstdint.hpp>
#include <boost/timer/timer.hpp>
#include <iostream>
#include <cstdlib>
#include <string>
#include <boost/detail/lightweight_main.hpp>
#ifdef _MSC_VER
# pragma warning (push)
# pragma warning (disable : 4459)
#endif
#include <boost/lexical_cast.hpp>
#ifdef _MSC_VER
# pragma warning (pop)
#endif
using namespace boost;
using namespace boost::endian;
using std::cout;
using std::endl;
namespace
{
typedef boost::timer::nanosecond_type nanosecond_t;
std::string command_args;
uint64_t n; // number of test cases to run
int places = 2; // decimal places for times
bool verbose (false);
bool time_aligned (true);
bool time_unaligned (true);
bool time_16(true);
bool time_32(true);
bool time_64(true);
void process_command_line(int argc, char * argv[])
{
for (int a = 0; a < argc; ++a)
{
command_args += argv[a];
if (a != argc-1)
command_args += ' ';
}
// cout << command_args << '\n';;
if (argc >=2)
#ifndef _MSC_VER
n = atoll(argv[1]);
#else
n = _atoi64(argv[1]);
#endif
for (; argc > 2; ++argv, --argc)
{
if ( *(argv[2]+1) == 'p' )
places = atoi( argv[2]+2 );
else if (*(argv[2] + 1) == 'v')
verbose = true;
else if (*(argv[2] + 1) == 'a')
time_unaligned = false;
else if (*(argv[2] + 1) == 'u')
time_aligned = false;
else if (*(argv[2] + 1) == '1')
time_32 = time_64 = false;
else if (*(argv[2] + 1) == '3')
time_16 = time_64 = false;
else if (*(argv[2] + 1) == '6')
time_16 = time_32 = false;
else
{
cout << "Error - unknown option: " << argv[2] << "\n\n";
argc = -1;
break;
}
}
if (argc < 2)
{
cout << "Usage: loop_time_test n [Options]\n"
" The argument n specifies the number of test cases to run\n"
" Options:\n"
" -v Verbose messages\n"
" -p# Decimal places for times; default -p" << places << "\n"
" -a Aligned tests only\n"
" -u Unaligned tests only\n"
" -16 16-bit tests only\n"
" -32 32-bit tests only\n"
" -64 64-bit tests only\n"
;
return std::exit(1);
}
}
std::string with_digit_separator(int64_t x)
{
std::string s = boost::lexical_cast<std::string>(x);
std::string s2;
for (std::string::size_type i = 0; i < s.size(); ++i)
{
if (i && ((s.size()-i) % 3) == 0)
s2 += '\'';
s2 += s[i];
}
return s2;
}
//--------------------------------------------------------------------------------------//
template <class T, class EndianT>
void time()
{
T total = 0;
{
// cout << "*************Endian integer approach...\n";
EndianT x(0);
boost::timer::cpu_timer t;
for (uint64_t i = 0; i < n; ++i)
{
x += static_cast<T>(i);
}
t.stop();
total += x;
cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>";
}
{
// cout << "***************Endian conversion approach...\n";
T x(0);
boost::timer::cpu_timer t;
native_to_big_inplace(x);
for (uint64_t i = 0; i < n; ++i)
{
x += static_cast<T>(i);
}
big_to_native_inplace(x);
t.stop();
native_to_big_inplace(x);
if (x != total)
throw std::logic_error("integer approach total != conversion approach total");
cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>";
}
}
void test_big_align_int16()
{
cout << "<tr><td>16-bit aligned big endian</td>";
time<int16_t, big_int16_at>();
cout << "</tr>\n";
}
void test_little_align_int16()
{
cout << "<tr><td>16-bit aligned little endian</td>";
time<int16_t, little_int16_at>();
cout << "</tr>\n";
}
void test_big_int16()
{
cout << "<tr><td>16-bit unaligned big endian</td>";
time<int16_t, big_int16_t>();
cout << "</tr>\n";
}
void test_little_int16()
{
cout << "<tr><td>16-bit unaligned little endian</td>";
time<int16_t, little_int16_t>();
cout << "</tr>\n";
}
void test_big_align_int32()
{
cout << "<tr><td>32-bit aligned big endian</td>";
time<int32_t, big_int32_at>();
cout << "</tr>\n";
}
void test_little_align_int32()
{
cout << "<tr><td>32-bit aligned little endian</td>";
time<int32_t, little_int32_at>();
cout << "</tr>\n";
}
void test_big_int32()
{
cout << "<tr><td>32-bit unaligned big endian</td>";
time<int32_t, big_int32_t>();
cout << "</tr>\n";
}
void test_little_int32()
{
cout << "<tr><td>32-bit unaligned little endian</td>";
time<int32_t, little_int32_t>();
cout << "</tr>\n";
}
void test_big_align_int64()
{
cout << "<tr><td>64-bit aligned big endian</td>";
time<int64_t, big_int64_at>();
cout << "</tr>\n";
}
void test_little_align_int64()
{
cout << "<tr><td>64-bit aligned little endian</td>";
time<int64_t, little_int64_at>();
cout << "</tr>\n";
}
void test_big_int64()
{
cout << "<tr><td>64-bit unaligned big endian</td>";
time<int64_t, big_int64_t>();
cout << "</tr>\n";
}
void test_little_int64()
{
cout << "<tr><td>64-bit unaligned little endian</td>";
time<int64_t, little_int64_t>();
cout << "</tr>\n";
}
} // unnamed namespace
//--------------------------------------------------------------------------------------//
int cpp_main(int argc, char* argv[])
{
process_command_line(argc, argv);
cout
<< "<html>\n<head>\n<title>Endian Loop Time Test</title>\n</head>\n<body>\n"
<< "<!-- boost-no-inspect -->\n"
<< "<div align=\"center\"> <center>\n"
<< "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\""
<< "style=\"border-collapse: collapse\" bordercolor=\"#111111\">\n"
<< "<tr><td colspan=\"6\" align=\"center\"><b>"
<< BOOST_COMPILER << "</b></td></tr>\n"
<< "<tr><td colspan=\"6\" align=\"center\"><b>"
<< " Iterations: " << with_digit_separator(n)
<< ", Intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG
<< "</b></td></tr>\n"
<< "<tr><td><b>Test Case</b></td>\n"
"<td align=\"center\"><b>Endian<br>arithmetic<br>type</b></td>\n"
"<td align=\"center\"><b>Endian<br>conversion<br>function</b></td>\n"
"</tr>\n"
;
if (time_aligned)
{
if (time_16)
{
test_big_align_int16();
test_little_align_int16();
}
if (time_32)
{
test_big_align_int32();
test_little_align_int32();
}
if (time_64)
{
test_big_align_int64();
test_little_align_int64();
}
}
if (time_unaligned)
{
if (time_16)
{
test_big_int16();
test_little_int16();
}
if (time_32)
{
test_big_int32();
test_little_int32();
}
if (time_64)
{
test_big_int64();
test_little_int64();
}
}
cout << "\n</div> </center>\n"
<< "\n</table>\n</body>\n</html>\n";
return 0;
}
#include <boost/endian/detail/disable_warnings_pop.hpp>

View File

@@ -0,0 +1,138 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D9C80FE0-20A6-4711-A3F4-676019BD5A06}</ProjectGuid>
<RootNamespace>associatedfiles</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\boost\endian\arithmetic.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\buffers.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\conversion.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\detail\config.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\detail\cover_operators.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings_pop.hpp" />
<ClInclude Include="..\..\..\include\boost\endian\detail\intrinsic.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\doc\arithmetic.html" />
<None Include="..\..\..\doc\buffers.html" />
<None Include="..\..\..\doc\conversion.html" />
<None Include="..\..\..\doc\index.html" />
<None Include="..\..\..\doc\mini_review_topics.html" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="HTML Files">
<UniqueIdentifier>{f0ee044b-7428-42ef-a455-a9b440bd64d3}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\boost\endian\arithmetic.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\buffers.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\conversion.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\detail\config.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\detail\cover_operators.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings_pop.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\boost\endian\detail\intrinsic.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\doc\conversion.html">
<Filter>HTML Files</Filter>
</None>
<None Include="..\..\..\doc\buffers.html">
<Filter>HTML Files</Filter>
</None>
<None Include="..\..\..\doc\index.html">
<Filter>HTML Files</Filter>
</None>
<None Include="..\..\..\doc\mini_review_topics.html">
<Filter>HTML Files</Filter>
</None>
<None Include="..\..\..\doc\arithmetic.html">
<Filter>HTML Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,178 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C9FEAE75-4DD9-44F5-B302-9910559A91BE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>benchmark</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 10 -v</Command>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 10 -v</Command>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 10000 -v</Command>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 10000 -v</Command>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\benchmark.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>buffer_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\buffer_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir>$(SolutionName)\$(Configuration)\</OutDir>
<IntDir>$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\..\..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>EnableAllWarnings</WarningLevel>
<PreprocessorDefinitions>BOOST_LIGHTWEIGHT_TEST_OSTREAM=std::cout;BOOST_ALL_DYN_LINK;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<PostBuildEvent>
<Message>Executing test $(TargetName).exe...</Message>
<Command>"$(TargetDir)\$(TargetName).exe"</Command>
</PostBuildEvent>
<Link>
<AdditionalLibraryDirectories>../../../../..\stage\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
</Project>

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0DA4B909-1E3D-43A2-A248-3FE73E499726}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>conversion_test_clang</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_clang_3_7</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140_Clang_3_7</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>EnableAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<ExceptionHandling>Enabled</ExceptionHandling>
<AdditionalIncludeDirectories>../../../../../</AdditionalIncludeDirectories>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ExceptionHandling>Enabled</ExceptionHandling>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\conversion_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1139E765-DE0F-497A-A7D9-EB2683521DF1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>conversion_use_case</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\example\conversion_use_case.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\conversion_test.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>converter_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Message>Executing test...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DA4BC67F-9284-4D2C-81D5-407312C31BD7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>deprecated_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\deprecated_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "conversion_test_clang", "conversion_test_clang\conversion_test_clang.vcxproj", "{0DA4B909-1E3D-43A2-A248-3FE73E499726}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Debug|x64.ActiveCfg = Debug|x64
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Debug|x64.Build.0 = Debug|x64
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Debug|x86.ActiveCfg = Debug|Win32
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Debug|x86.Build.0 = Debug|Win32
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Release|x64.ActiveCfg = Release|x64
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Release|x64.Build.0 = Release|x64
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Release|x86.ActiveCfg = Release|Win32
{0DA4B909-1E3D-43A2-A248-3FE73E499726}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,160 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_test", "endian_test\endian_test.vcxproj", "{74C201F3-8308-40BE-BC0F-24974DEAF405}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_in_union_test", "endian_in_union_test\endian_in_union_test.vcxproj", "{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_operations_test", "endian_operations_test\endian_operations_test.vcxproj", "{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scoped_enum_emulation_test", "scoped_enum_emulation_test\scoped_enum_emulation_test.vcxproj", "{8420E151-B23B-4651-B526-6AB11EF1E278}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_example", "endian_example\endian_example.vcxproj", "{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "benchmark\benchmark.vcxproj", "{C9FEAE75-4DD9-44F5-B302-9910559A91BE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "converter_test", "converter_test\converter_test.vcxproj", "{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udt_conversion_example", "udt_conversion_example\udt_conversion_example.vcxproj", "{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speed_test", "speed_test\speed_test.vcxproj", "{5407AF29-59E9-4DE2-9939-F067576F7868}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loop_time_test", "loop_time_test\loop_time_test.vcxproj", "{541A2D06-B34E-4592-BE47-F87DF47E73D8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buffer_test", "buffer_test\buffer_test.vcxproj", "{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "conversion_use_case", "conversion_use_case\conversion_use_case.vcxproj", "{1139E765-DE0F-497A-A7D9-EB2683521DF1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "associated-files", "associated-files\associated-files.vcxproj", "{D9C80FE0-20A6-4711-A3F4-676019BD5A06}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "experiment", "experiment\experiment.vcxproj", "{CE9D8719-6E86-41D0-97CA-5BE5272594E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "deprecated_test", "deprecated_test\deprecated_test.vcxproj", "{DA4BC67F-9284-4D2C-81D5-407312C31BD7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|Win32.ActiveCfg = Debug|Win32
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|Win32.Build.0 = Debug|Win32
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|x64.ActiveCfg = Debug|x64
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|x64.Build.0 = Debug|x64
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|Win32.ActiveCfg = Release|Win32
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|Win32.Build.0 = Release|Win32
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|x64.ActiveCfg = Release|x64
{74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|x64.Build.0 = Release|x64
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|Win32.ActiveCfg = Debug|Win32
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|Win32.Build.0 = Debug|Win32
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|x64.ActiveCfg = Debug|x64
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|x64.Build.0 = Debug|x64
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|Win32.ActiveCfg = Release|Win32
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|Win32.Build.0 = Release|Win32
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|x64.ActiveCfg = Release|x64
{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|x64.Build.0 = Release|x64
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|Win32.ActiveCfg = Debug|Win32
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|Win32.Build.0 = Debug|Win32
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|x64.ActiveCfg = Debug|x64
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|x64.Build.0 = Debug|x64
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|Win32.ActiveCfg = Release|Win32
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|Win32.Build.0 = Release|Win32
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|x64.ActiveCfg = Release|x64
{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|x64.Build.0 = Release|x64
{8420E151-B23B-4651-B526-6AB11EF1E278}.Debug|Win32.ActiveCfg = Debug|Win32
{8420E151-B23B-4651-B526-6AB11EF1E278}.Debug|x64.ActiveCfg = Debug|x64
{8420E151-B23B-4651-B526-6AB11EF1E278}.Release|Win32.ActiveCfg = Release|Win32
{8420E151-B23B-4651-B526-6AB11EF1E278}.Release|x64.ActiveCfg = Release|x64
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|Win32.ActiveCfg = Debug|Win32
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|Win32.Build.0 = Debug|Win32
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|x64.ActiveCfg = Debug|x64
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|x64.Build.0 = Debug|x64
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|Win32.ActiveCfg = Release|Win32
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|Win32.Build.0 = Release|Win32
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|x64.ActiveCfg = Release|x64
{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|x64.Build.0 = Release|x64
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|Win32.ActiveCfg = Debug|Win32
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|Win32.Build.0 = Debug|Win32
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|x64.ActiveCfg = Debug|x64
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|x64.Build.0 = Debug|x64
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|Win32.ActiveCfg = Release|Win32
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|Win32.Build.0 = Release|Win32
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|x64.ActiveCfg = Release|x64
{C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|x64.Build.0 = Release|x64
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|Win32.ActiveCfg = Debug|Win32
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|Win32.Build.0 = Debug|Win32
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|x64.ActiveCfg = Debug|x64
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|x64.Build.0 = Debug|x64
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|Win32.ActiveCfg = Release|Win32
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|Win32.Build.0 = Release|Win32
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|x64.ActiveCfg = Release|x64
{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|x64.Build.0 = Release|x64
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|Win32.ActiveCfg = Debug|Win32
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|Win32.Build.0 = Debug|Win32
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|x64.ActiveCfg = Debug|x64
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|x64.Build.0 = Debug|x64
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|Win32.ActiveCfg = Release|Win32
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|Win32.Build.0 = Release|Win32
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|x64.ActiveCfg = Release|x64
{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|x64.Build.0 = Release|x64
{5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|Win32.ActiveCfg = Debug|Win32
{5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|Win32.Build.0 = Debug|Win32
{5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|x64.ActiveCfg = Debug|x64
{5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|x64.Build.0 = Debug|x64
{5407AF29-59E9-4DE2-9939-F067576F7868}.Release|Win32.ActiveCfg = Release|Win32
{5407AF29-59E9-4DE2-9939-F067576F7868}.Release|Win32.Build.0 = Release|Win32
{5407AF29-59E9-4DE2-9939-F067576F7868}.Release|x64.ActiveCfg = Release|x64
{5407AF29-59E9-4DE2-9939-F067576F7868}.Release|x64.Build.0 = Release|x64
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|Win32.ActiveCfg = Debug|Win32
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|Win32.Build.0 = Debug|Win32
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|x64.ActiveCfg = Debug|x64
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|x64.Build.0 = Debug|x64
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|Win32.ActiveCfg = Release|Win32
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|Win32.Build.0 = Release|Win32
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|x64.ActiveCfg = Release|x64
{541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|x64.Build.0 = Release|x64
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|Win32.ActiveCfg = Debug|Win32
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|Win32.Build.0 = Debug|Win32
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|x64.ActiveCfg = Debug|x64
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|x64.Build.0 = Debug|x64
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|Win32.ActiveCfg = Release|Win32
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|Win32.Build.0 = Release|Win32
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|x64.ActiveCfg = Release|x64
{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|x64.Build.0 = Release|x64
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|Win32.ActiveCfg = Debug|Win32
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|Win32.Build.0 = Debug|Win32
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|x64.ActiveCfg = Debug|x64
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|x64.Build.0 = Debug|x64
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|Win32.ActiveCfg = Release|Win32
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|Win32.Build.0 = Release|Win32
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|x64.ActiveCfg = Release|x64
{1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|x64.Build.0 = Release|x64
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|Win32.ActiveCfg = Debug|Win32
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|Win32.Build.0 = Debug|Win32
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|x64.ActiveCfg = Debug|x64
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|x64.Build.0 = Debug|x64
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|Win32.ActiveCfg = Release|Win32
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|Win32.Build.0 = Release|Win32
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|x64.ActiveCfg = Release|x64
{D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|x64.Build.0 = Release|x64
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|Win32.ActiveCfg = Debug|Win32
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|Win32.Build.0 = Debug|Win32
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|x64.ActiveCfg = Debug|Win32
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|Win32.ActiveCfg = Release|Win32
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|Win32.Build.0 = Release|Win32
{CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|x64.ActiveCfg = Release|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|Win32.ActiveCfg = Debug|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|Win32.Build.0 = Debug|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|x64.ActiveCfg = Debug|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.ActiveCfg = Release|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.Build.0 = Release|Win32
{DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}</ProjectGuid>
<RootNamespace>endian_example</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\example\endian_example.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}</ProjectGuid>
<RootNamespace>endian_in_union_test</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\endian_in_union_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}</ProjectGuid>
<RootNamespace>endian_operations_test</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4552;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4552;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\endian_operations_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{74C201F3-8308-40BE-BC0F-24974DEAF405}</ProjectGuid>
<RootNamespace>endian_test</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\endian_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{541A2D06-B34E-4592-BE47-F87DF47E73D8}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>loop_time_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 1234</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 1</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
<AssemblerListingLocation>c:/temp/</AssemblerListingLocation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 1000000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\loop_time_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{8420E151-B23B-4651-B526-6AB11EF1E278}</ProjectGuid>
<RootNamespace>scoped_enum_emulation_test</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\scoped_enum_emulation_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{5407AF29-59E9-4DE2-9939-F067576F7868}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>speed_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 1000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 1000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\speed_test.cpp" />
<ClCompile Include="..\..\speed_test_functions.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>udt_conversion_example</RootNamespace>
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\example\udt_conversion_example.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{36BF451A-EAEF-4140-92E4-6EA461A26107}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>uses_cases</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\common.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\example\use_cases.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,87 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/detail/order.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
#include <ostream>
#include <iomanip>
#if defined(_MSC_VER)
# pragma warning(disable: 4127) // conditional expression is constant
#endif
class byte_span
{
private:
unsigned char const * p_;
std::size_t n_;
public:
byte_span( unsigned char const * p, std::size_t n ): p_( p ), n_( n )
{
}
template<std::size_t N> explicit byte_span( unsigned char const (&a)[ N ] ): p_( a ), n_( N )
{
}
bool operator==( byte_span const& r ) const
{
if( n_ != r.n_ ) return false;
for( std::size_t i = 0; i < n_; ++i )
{
if( p_[ i ] != r.p_[ i ] ) return false;
}
return true;
}
friend std::ostream& operator<<( std::ostream& os, byte_span s )
{
if( s.n_ == 0 ) return os;
os << std::hex << std::setfill( '0' ) << std::uppercase;
os << std::setw( 2 ) << +s.p_[ 0 ];
for( std::size_t i = 1; i < s.n_; ++i )
{
os << ':' << std::setw( 2 ) << +s.p_[ i ];
}
os << std::dec << std::setfill( ' ' ) << std::nouppercase;
return os;
}
};
int main()
{
boost::uint64_t v = static_cast<boost::uint64_t>( 0x0102030405060708ull );
byte_span v2( reinterpret_cast<unsigned char const*>( &v ), sizeof(v) );
if( boost::endian::order::native == boost::endian::order::little )
{
unsigned char w[] = { 8, 7, 6, 5, 4, 3, 2, 1 };
BOOST_TEST_EQ( v2, byte_span( w ) );
}
else if( boost::endian::order::native == boost::endian::order::big )
{
unsigned char w[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
BOOST_TEST_EQ( v2, byte_span( w ) );
}
else
{
BOOST_ERROR( "boost::endian::order::native is neither big nor little" );
}
return boost::report_errors();
}

View File

@@ -0,0 +1,38 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#if !defined(__GNUC__)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE( "Skipping test because __GNUC__ is not defined" )
int main() {}
#else
#define BOOST_ENDIAN_FORCE_PODNESS
#define BOOST_ENDIAN_NO_CTORS
#include <boost/endian/arithmetic.hpp>
#include <boost/core/lightweight_test.hpp>
using namespace boost::endian;
struct X
{
big_uint16_t a;
native_float64_t b;
little_uint16_t c;
} __attribute__((packed));
int main()
{
BOOST_TEST_EQ( sizeof(big_uint16_t), 2 );
BOOST_TEST_EQ( sizeof(native_float64_t), 8 );
BOOST_TEST_EQ( sizeof(little_uint16_t), 2 );
BOOST_TEST_EQ( sizeof(X), 12 );
return boost::report_errors();
}
#endif

View File

@@ -0,0 +1,38 @@
// Copyright 2020 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#if !defined(__GNUC__)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE( "Skipping test because __GNUC__ is not defined" )
int main() {}
#else
#define BOOST_ENDIAN_FORCE_PODNESS
#define BOOST_ENDIAN_NO_CTORS
#include <boost/endian/buffers.hpp>
#include <boost/core/lightweight_test.hpp>
using namespace boost::endian;
struct X
{
big_uint16_buf_t a;
native_float64_buf_t b;
little_uint16_buf_t c;
} __attribute__((packed));
int main()
{
BOOST_TEST_EQ( sizeof(big_uint16_buf_t), 2 );
BOOST_TEST_EQ( sizeof(native_float64_buf_t), 8 );
BOOST_TEST_EQ( sizeof(little_uint16_buf_t), 2 );
BOOST_TEST_EQ( sizeof(X), 12 );
return boost::report_errors();
}
#endif

View File

@@ -0,0 +1,31 @@
// Copyright 2019 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/arithmetic.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
using namespace boost::endian;
{
little_uint32_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x04 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x01 );
}
{
big_uint32_t v( 0x01020304 );
BOOST_TEST_EQ( v.data()[ 0 ], 0x01 );
BOOST_TEST_EQ( v.data()[ 1 ], 0x02 );
BOOST_TEST_EQ( v.data()[ 2 ], 0x03 );
BOOST_TEST_EQ( v.data()[ 3 ], 0x04 );
}
return boost::report_errors();
}

View File

@@ -0,0 +1,48 @@
// scoped_enum_emulation_test.cpp ----------------------------------------------------//
// Copyright Beman Dawes, 2009
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
// See documentation at http://www.boost.org/libs/utility/scoped_enum_emulation.html
// #include <boost/detail/disable_warnings.hpp>
// #include <boost/config/warning_disable.hpp>
#include <boost/detail/scoped_enum_emulation.hpp>
#include <boost/assert.hpp>
BOOST_SCOPED_ENUM_START(traffic_light) { red=0, yellow, green }; BOOST_SCOPED_ENUM_END
BOOST_SCOPED_ENUM_START(algae) { green=0, red, cyan }; BOOST_SCOPED_ENUM_END
struct color
{
BOOST_SCOPED_ENUM_START(value_t) { red, green, blue }; BOOST_SCOPED_ENUM_END
BOOST_SCOPED_ENUM(value_t) value;
};
void foo( BOOST_SCOPED_ENUM(algae) arg )
{
BOOST_ASSERT( arg == algae::cyan );
}
int main()
{
BOOST_SCOPED_ENUM(traffic_light) signal( traffic_light::red );
BOOST_SCOPED_ENUM(algae) sample( algae::red );
BOOST_ASSERT( signal == traffic_light::red );
BOOST_ASSERT( sample == algae::red );
foo( algae::cyan );
color tracker;
tracker.value = color::value_t::blue;
if (tracker.value == color::value_t::blue) return 0; // quiet warnings
return 0;
}

View File

@@ -0,0 +1,194 @@
// speed_test.cpp --------------------------------------------------------------------//
// Copyright Beman Dawes 2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
//#define BOOST_ENDIAN_NO_INTRINSICS
#include <boost/endian/detail/disable_warnings.hpp>
#include "speed_test_functions.hpp"
#include <boost/endian/conversion.hpp>
#include <boost/endian/arithmetic.hpp>
#include <boost/cstdint.hpp>
#include <boost/timer/timer.hpp>
#include <iostream>
#include <cstdlib>
#include <boost/detail/lightweight_main.hpp>
using namespace boost;
using namespace boost::endian;
using std::cout;
using std::endl;
namespace
{
typedef boost::timer::nanosecond_type nanosecond_t;
std::string command_args;
uint64_t n; // number of test cases to run
int places = 2; // decimal places for times
bool verbose (false);
void process_command_line(int argc, char * argv[])
{
for (int a = 0; a < argc; ++a)
{
command_args += argv[a];
if (a != argc-1)
command_args += ' ';
}
// cout << command_args << '\n';;
if (argc >=2)
#ifndef _MSC_VER
n = atoll(argv[1]);
#else
n = _atoi64(argv[1]);
#endif
for (; argc > 2; ++argv, --argc)
{
if ( *(argv[2]+1) == 'p' )
places = atoi( argv[2]+2 );
else if ( *(argv[2]+1) == 'v' )
verbose = true;
else
{
cout << "Error - unknown option: " << argv[2] << "\n\n";
argc = -1;
break;
}
}
if (argc < 2)
{
cout << "Usage: speed_test n [Options]\n"
" The argument n specifies the number of test cases to run\n"
" Options:\n"
" -v Verbose messages\n"
" -p# Decimal places for times; default -p" << places << "\n";
return std::exit(1);
}
}
//--------------------------------------------------------------------------------------//
template <class T, class EndianT, class Function>
void time(Function f)
{
T x(0);
EndianT y(0);
boost::timer::cpu_timer t;
for (uint64_t i = 0; i < n; ++i)
{
f(x, y);
}
t.stop();
cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>";
}
void test_big_int16()
{
cout << "<tr><td>16-bit aligned big endian</td>";
time<int16_t, big_int16_t>(user::return_x_big_int16);
time<int16_t, big_int16_t>(user::return_x_value_big_int16);
time<int16_t, big_int16_t>(user::return_x_inplace_big_int16);
time<int16_t, big_int16_t>(user::return_y_big_int16);
cout << "</tr>\n";
}
void test_little_int16()
{
cout << "<tr><td>16-bit aligned little endian</td>";
time<int16_t, little_int16_t>(user::return_x_little_int16);
time<int16_t, little_int16_t>(user::return_x_value_little_int16);
time<int16_t, little_int16_t>(user::return_x_inplace_little_int16);
time<int16_t, little_int16_t>(user::return_y_little_int16);
cout << "</tr>\n";
}
void test_big_int32()
{
cout << "<tr><td>32-bit aligned big endian</td>";
time<int32_t, big_int32_t>(user::return_x_big_int32);
time<int32_t, big_int32_t>(user::return_x_value_big_int32);
time<int32_t, big_int32_t>(user::return_x_inplace_big_int32);
time<int32_t, big_int32_t>(user::return_y_big_int32);
cout << "</tr>\n";
}
void test_little_int32()
{
cout << "<tr><td>32-bit aligned little endian</td>";
time<int32_t, little_int32_t>(user::return_x_little_int32);
time<int32_t, little_int32_t>(user::return_x_value_little_int32);
time<int32_t, little_int32_t>(user::return_x_inplace_little_int32);
time<int32_t, little_int32_t>(user::return_y_little_int32);
cout << "</tr>\n";
}
void test_big_int64()
{
cout << "<tr><td>64-bit aligned big endian</td>";
time<int64_t, big_int64_t>(user::return_x_big_int64);
time<int64_t, big_int64_t>(user::return_x_value_big_int64);
time<int64_t, big_int64_t>(user::return_x_inplace_big_int64);
time<int64_t, big_int64_t>(user::return_y_big_int64);
cout << "</tr>\n";
}
void test_little_int64()
{
cout << "<tr><td>64-bit aligned little endian</td>";
time<int64_t, little_int64_t>(user::return_x_little_int64);
time<int64_t, little_int64_t>(user::return_x_value_little_int64);
time<int64_t, little_int64_t>(user::return_x_inplace_little_int64);
time<int64_t, little_int64_t>(user::return_y_little_int64);
cout << "</tr>\n";
}
} // unnamed namespace
//--------------------------------------------------------------------------------------//
int cpp_main(int argc, char* argv[])
{
process_command_line(argc, argv);
cout
<< "<html>\n<head>\n<title>Endian Speed Test</title>\n</head>\n<body>\n"
<< "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\""
<< "style=\"border-collapse: collapse\" bordercolor=\"#111111\">\n"
<< "<tr><td colspan=\"6\" align=\"center\"><b>"
<< BOOST_COMPILER << "</b></td></tr>\n"
<< "<tr><td colspan=\"6\" align=\"center\"><b>"
<< " Iterations: " << n
<< ", Intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG
<< "</b></td></tr>\n"
<< "<tr><td><b>Test Case</b></td>\n"
"<td align=\"center\"><b>int<br>arg</b></td>\n"
"<td align=\"center\"><b>int<br>value(arg)</b></td>\n"
"<td align=\"center\"><b>int<br>in place(arg)</b></td>\n"
"<td align=\"center\"><b>Endian<br>arg</b></td>\n"
"</tr>\n"
;
test_big_int16();
test_little_int16();
test_big_int32();
test_little_int32();
test_big_int64();
test_little_int64();
cout << "\n</table>\n</body>\n</html>\n";
return 0;
}
#include <boost/endian/detail/disable_warnings_pop.hpp>

View File

@@ -0,0 +1,96 @@
// speed_test_functions.cpp ----------------------------------------------------------//
// Copyright Beman Dawes 2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
// These functions are in a separate compilation unit partially to defeat optimizers
// and partially to create a worst case scenario. They are in a user namespace for
// realism.
//--------------------------------------------------------------------------------------//
#ifndef _SCL_SECURE_NO_WARNINGS
# define _SCL_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
#endif
#include "speed_test_functions.hpp"
namespace user
{
int16_t return_x_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT { return x; }
int16_t return_x_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT { return x; }
int16_t return_x_value_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::big>(x);
}
int16_t return_x_value_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::little>(x);
}
int16_t return_x_inplace_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::big>(x); return x;
}
int16_t return_x_inplace_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::little>(x); return x;
}
int16_t return_y_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT { return y; }
int16_t return_y_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT { return y; }
//------------------------------------------------------------------------------------//
int32_t return_x_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT { return x; }
int32_t return_x_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT { return x; }
int32_t return_x_value_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::big>(x);
}
int32_t return_x_value_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::little>(x);
}
int32_t return_x_inplace_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::big>(x); return x;
}
int32_t return_x_inplace_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::little>(x); return x;
}
int32_t return_y_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT { return y; }
int32_t return_y_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT { return y; }
//------------------------------------------------------------------------------------//
int64_t return_x_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT { return x; }
int64_t return_x_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT { return x; }
int64_t return_x_value_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::big>(x);
}
int64_t return_x_value_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT
{
return conditional_reverse<order::native, order::little>(x);
}
int64_t return_x_inplace_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::big>(x); return x;
}
int64_t return_x_inplace_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT
{
conditional_reverse_inplace<order::native, order::little>(x); return x;
}
int64_t return_y_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT { return y; }
int64_t return_y_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT { return y; }
}

View File

@@ -0,0 +1,56 @@
// speed_test_functions.hpp ----------------------------------------------------------//
// Copyright Beman Dawes 2013
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
//--------------------------------------------------------------------------------------//
// These functions are separately compiled partially to defeat optimizers and
// partially to create a worst case scenario. They are in a user namespace for
// a bit of realism.
//--------------------------------------------------------------------------------------//
#ifndef BOOST_ENDIAN_SPEED_TEST_FUNCTIONS_HPP
#define BOOST_ENDIAN_SPEED_TEST_FUNCTIONS_HPP
#include <boost/cstdint.hpp>
#include <boost/endian/arithmetic.hpp>
namespace user
{
using namespace boost;
using namespace boost::endian;
int16_t return_x_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT;
int16_t return_x_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT;
int16_t return_x_value_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT;
int16_t return_x_value_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT;
int16_t return_x_inplace_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT;
int16_t return_x_inplace_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT;
int16_t return_y_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT;
int16_t return_y_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT;
int32_t return_x_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT;
int32_t return_x_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT;
int32_t return_x_value_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT;
int32_t return_x_value_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT;
int32_t return_x_inplace_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT;
int32_t return_x_inplace_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT;
int32_t return_y_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT;
int32_t return_y_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT;
int64_t return_x_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT;
int64_t return_x_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT;
int64_t return_x_value_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT;
int64_t return_x_value_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT;
int64_t return_x_inplace_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT;
int64_t return_x_inplace_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT;
int64_t return_y_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT;
int64_t return_y_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT;
}
#endif

View File

@@ -0,0 +1,23 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#if defined(_MSC_VER)
# pragma warning( disable: 4510 ) // default constructor not generated
# pragma warning( disable: 4512 ) // assignment operator not generated
# pragma warning( disable: 4610 ) // class can never be instantiated
#endif
#include <boost/spirit/include/qi.hpp>
#include <boost/endian/arithmetic.hpp>
struct record
{
boost::endian::big_int16_t type;
record( boost::int16_t t )
{
type = t;
}
};

View File

@@ -0,0 +1,277 @@
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/endian/conversion.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <cstddef>
#include <ostream>
#include <iomanip>
class byte_span
{
private:
unsigned char const * p_;
std::size_t n_;
public:
byte_span( unsigned char const * p, std::size_t n ): p_( p ), n_( n )
{
}
template<std::size_t N> explicit byte_span( unsigned char const (&a)[ N ] ): p_( a ), n_( N )
{
}
bool operator==( byte_span const& r ) const
{
if( n_ != r.n_ ) return false;
for( std::size_t i = 0; i < n_; ++i )
{
if( p_[ i ] != r.p_[ i ] ) return false;
}
return true;
}
friend std::ostream& operator<<( std::ostream& os, byte_span s )
{
if( s.n_ == 0 ) return os;
os << std::hex << std::setfill( '0' ) << std::uppercase;
os << std::setw( 2 ) << +s.p_[ 0 ];
for( std::size_t i = 1; i < s.n_; ++i )
{
os << ':' << std::setw( 2 ) << +s.p_[ i ];
}
os << std::dec << std::setfill( ' ' ) << std::nouppercase;;
return os;
}
};
int main()
{
using namespace boost::endian;
// 16
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA };
store_little_s16( v, -3343 );
unsigned char w1[] = { 0xF1, 0xF2, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u16( v, 0x0201 );
unsigned char w2[] = { 0x01, 0x02, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s16( v, -3343 );
unsigned char w3[] = { 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u16( v, 0x0201 );
unsigned char w4[] = { 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 24
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s24( v, -789775 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u24( v, 0x030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s24( v, -789775 );
unsigned char w3[] = { 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u24( v, 0x030201 );
unsigned char w4[] = { 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 32
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s32( v, 0xF4F3F2F1 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u32( v, 0x04030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0x04, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s32( v, 0xF4F3F2F1 );
unsigned char w3[] = { 0xF4, 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u32( v, 0x04030201 );
unsigned char w4[] = { 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 40
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s40( v, -43135012111 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u40( v, 0x0504030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s40( v, -43135012111 );
unsigned char w3[] = { 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u40( v, 0x0504030201 );
unsigned char w4[] = { 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 48
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s48( v, -9938739662095 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u48( v, 0x060504030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s48( v, -9938739662095 );
unsigned char w3[] = { 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u48( v, 0x060504030201 );
unsigned char w4[] = { 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 56
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s56( v, -2261738553347343 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u56( v, 0x07060504030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s56( v, -2261738553347343 );
unsigned char w3[] = { 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u56( v, 0x07060504030201 );
unsigned char w4[] = { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
// 64
{
unsigned char v[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
store_little_s64( v, 0xF8F7F6F5F4F3F2F1 );
unsigned char w1[] = { 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w1 ) );
store_little_u64( v, 0x0807060504030201 );
unsigned char w2[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w2 ) );
store_big_s64( v, 0xF8F7F6F5F4F3F2F1 );
unsigned char w3[] = { 0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w3 ) );
store_big_u64( v, 0x0807060504030201 );
unsigned char w4[] = { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0xAA };
BOOST_TEST_EQ( byte_span( v ), byte_span( w4 ) );
}
return boost::report_errors();
}