Builds almost completely cleanly with -WEverything in LLVM

This commit is contained in:
Phil Nash 2012-08-13 07:46:10 +01:00
parent cdc64a138b
commit a695eb9006
37 changed files with 1045 additions and 966 deletions

View file

@ -16,9 +16,9 @@
#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
#ifdef __GNUC__
#define ATTRIBUTE_NORETURN __attribute__ ((noreturn))
#define CATCH_ATTRIBUTE_NORETURN __attribute__ ((noreturn))
#else
#define ATTRIBUTE_NORETURN
#define CATCH_ATTRIBUTE_NORETURN
#endif
#include <sstream>
@ -32,7 +32,7 @@ namespace Catch {
void operator = ( const NonCopyable& );
protected:
NonCopyable() {}
virtual ~NonCopyable() {}
virtual ~NonCopyable();
};
class SafeBool {
@ -110,21 +110,16 @@ namespace Catch {
return os;
}
ATTRIBUTE_NORETURN
inline void throwLogicError( const std::string& message, const std::string& file, std::size_t line ) {
CATCH_ATTRIBUTE_NORETURN
inline void throwLogicError( const std::string& message, const SourceLineInfo& locationInfo ) {
std::ostringstream oss;
oss << "Internal Catch error: '" << message << "' at: " << SourceLineInfo( file, line );
oss << "Internal Catch error: '" << message << "' at: " << locationInfo;
throw std::logic_error( oss.str() );
}
}
#define CATCH_INTERNAL_ERROR( msg ) throwLogicError( msg, __FILE__, __LINE__ );
//#ifdef __FUNCTION__
//#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FUNCTION__, __FILE__, __LINE__ )
//#else
#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, __LINE__ )
//#endif
#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
#endif // TWOBLUECUBES_CATCH_COMMON_H_INCLUDED