X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fcore%2Flightweight_test.hpp;fp=ceph%2Fsrc%2Fboost%2Fboost%2Fcore%2Flightweight_test.hpp;h=3b5df899457af1a734c8c8be5ac5bf080a7bcdab;hb=1e59de90020f1d8d374046ef9cca56ccd4e806e2;hp=eff5554b7eb1e15cacb8e955c30a758772ed6eb0;hpb=bd41e436e25044e8e83156060a37c23cb661c364;p=ceph.git diff --git a/ceph/src/boost/boost/core/lightweight_test.hpp b/ceph/src/boost/boost/core/lightweight_test.hpp index eff5554b7..3b5df8994 100644 --- a/ceph/src/boost/boost/core/lightweight_test.hpp +++ b/ceph/src/boost/boost/core/lightweight_test.hpp @@ -27,9 +27,12 @@ #include #include #include +#include #include #include #include +#include +#include #if defined(_MSC_VER) && defined(_CPPLIB_VER) && defined(_DEBUG) # include @@ -173,6 +176,51 @@ template inline const void* test_output_impl(T volatile* v) { return co inline const void* test_output_impl(std::nullptr_t) { return nullptr; } #endif +// print chars as numeric + +inline int test_output_impl( signed char const& v ) { return v; } +inline unsigned test_output_impl( unsigned char const& v ) { return v; } + +// Whether wchar_t is signed is implementation-defined + +template struct lwt_long_type {}; +template<> struct lwt_long_type { typedef long type; }; +template<> struct lwt_long_type { typedef unsigned long type; }; + +inline lwt_long_type<(static_cast(-1) < static_cast(0))>::type test_output_impl( wchar_t const& v ) { return v; } + +#if !defined( BOOST_NO_CXX11_CHAR16_T ) +inline unsigned long test_output_impl( char16_t const& v ) { return v; } +#endif + +#if !defined( BOOST_NO_CXX11_CHAR32_T ) +inline unsigned long test_output_impl( char32_t const& v ) { return v; } +#endif + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable: 4996) +#endif + +inline std::string test_output_impl( char const& v ) +{ + if( std::isprint( static_cast( v ) ) ) + { + return std::string( 1, v ); + } + else + { + char buffer[ 8 ]; + std::sprintf( buffer, "\\x%02X", static_cast( v ) ); + + return buffer; + } +} + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + // predicates struct lw_test_eq