mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-23 05:46:11 +01:00
Only add wstring versions of toString if wchar_t has been defined. This fixes some issues on embedded platforms where wstring isn't available.
This commit is contained in:
parent
cf5ced59d1
commit
6498a5112c
@ -73,6 +73,7 @@ inline std::string toString( const std::string& value ) {
|
|||||||
return "\"" + value + "\"";
|
return "\"" + value + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef wchar_t
|
||||||
inline std::string toString( const std::wstring& value ) {
|
inline std::string toString( const std::wstring& value ) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "\"";
|
oss << "\"";
|
||||||
@ -81,6 +82,7 @@ inline std::string toString( const std::wstring& value ) {
|
|||||||
oss << "\"";
|
oss << "\"";
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inline std::string toString( const char* const value ) {
|
inline std::string toString( const char* const value ) {
|
||||||
return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
|
return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
|
||||||
|
@ -545,6 +545,7 @@ inline std::string toString( const std::string& value ) {
|
|||||||
return "\"" + value + "\"";
|
return "\"" + value + "\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef wchar_t
|
||||||
inline std::string toString( const std::wstring& value ) {
|
inline std::string toString( const std::wstring& value ) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "\"";
|
oss << "\"";
|
||||||
@ -553,6 +554,7 @@ inline std::string toString( const std::wstring& value ) {
|
|||||||
oss << "\"";
|
oss << "\"";
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inline std::string toString( const char* const value ) {
|
inline std::string toString( const char* const value ) {
|
||||||
return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
|
return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
|
||||||
|
Loading…
Reference in New Issue
Block a user