mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +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:
		@@ -73,6 +73,7 @@ inline std::string toString( const std::string& value ) {
 | 
			
		||||
    return "\"" + value + "\"";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef wchar_t
 | 
			
		||||
inline std::string toString( const std::wstring& value ) {
 | 
			
		||||
    std::ostringstream oss;
 | 
			
		||||
    oss << "\"";
 | 
			
		||||
@@ -81,6 +82,7 @@ inline std::string toString( const std::wstring& value ) {
 | 
			
		||||
    oss << "\"";
 | 
			
		||||
    return oss.str();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
inline std::string toString( const char* const value ) {
 | 
			
		||||
    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 + "\"";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef wchar_t
 | 
			
		||||
inline std::string toString( const std::wstring& value ) {
 | 
			
		||||
    std::ostringstream oss;
 | 
			
		||||
    oss << "\"";
 | 
			
		||||
@@ -553,6 +554,7 @@ inline std::string toString( const std::wstring& value ) {
 | 
			
		||||
    oss << "\"";
 | 
			
		||||
    return oss.str();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
inline std::string toString( const char* const value ) {
 | 
			
		||||
    return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user