From b65ddb430acae6e2a1d863694ae5400ca9c85063 Mon Sep 17 00:00:00 2001 From: "James E. King III" Date: Sat, 13 Oct 2018 03:08:20 +0000 Subject: [PATCH] trac-12244: fix detection of wchar_t availability --- include/boost/logic/tribool_io.hpp | 6 +++--- test/tribool_io_test.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/boost/logic/tribool_io.hpp b/include/boost/logic/tribool_io.hpp index 0d7af8c..2696dca 100644 --- a/include/boost/logic/tribool_io.hpp +++ b/include/boost/logic/tribool_io.hpp @@ -45,7 +45,7 @@ template<> inline std::basic_string default_false_name() { return "false"; } -# ifndef BOOST_NO_WCHAR_T +# if !defined(BOOST_NO_CWCHAR) /** * \brief Returns the wide character string L"false". * @@ -76,7 +76,7 @@ template<> inline std::basic_string default_true_name() { return "true"; } -# ifndef BOOST_NO_WCHAR_T +# if !defined(BOOST_NO_CWCHAR) /** * \brief Returns the wide character string L"true". * @@ -104,7 +104,7 @@ template<> inline std::basic_string get_default_indeterminate_name() { return "indeterminate"; } -#ifndef BOOST_NO_WCHAR_T +#if !defined(BOOST_NO_CWCHAR) /// Returns the wide character string L"indeterminate". template<> inline std::basic_string get_default_indeterminate_name() diff --git a/test/tribool_io_test.cpp b/test/tribool_io_test.cpp index 84bce90..c2d5021 100644 --- a/test/tribool_io_test.cpp +++ b/test/tribool_io_test.cpp @@ -20,6 +20,18 @@ int test_main(int, char*[]) tribool x; + #if !defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_STD_WSTRING) + std::wostringstream wout; + wout << std::boolalpha << tribool(false); + BOOST_CHECK(wout.str() == L"false"); + wout.str(std::wstring()); + wout << std::boolalpha << tribool(true); + BOOST_CHECK(wout.str() == L"true"); + wout.str(std::wstring()); + wout << std::boolalpha << tribool(indeterminate); + BOOST_CHECK(wout.str() == L"indeterminate"); + #endif + // Check tribool output std::ostringstream out;