Split CATCH_CONFIG_WCHAR into its own header

Part of #2041
This commit is contained in:
Martin Hořeňovský 2020-12-28 20:29:05 +01:00
parent 0acb371b92
commit 1d269211bd
No known key found for this signature in database
GPG key ID: DE48307B8B0D381A
8 changed files with 43 additions and 14 deletions

View file

@ -14,6 +14,7 @@
#include <type_traits>
#include <string>
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <catch2/internal/catch_config_wchar.hpp>
#include <catch2/internal/catch_stream.hpp>
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
@ -162,7 +163,7 @@ namespace Catch {
static std::string convert(char * str);
};
#ifdef CATCH_CONFIG_WCHAR
#if defined(CATCH_CONFIG_WCHAR)
template<>
struct StringMaker<std::wstring> {
static std::string convert(const std::wstring& wstr);
@ -183,7 +184,7 @@ namespace Catch {
struct StringMaker<wchar_t *> {
static std::string convert(wchar_t * str);
};
#endif
#endif // CATCH_CONFIG_WCHAR
// TBD: Should we use `strnlen` to ensure that we don't go out of the buffer,
// while keeping string semantics?