mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 19:22:25 +01:00
Merge pull request #1 from afoster1/master
Need support for Sun Studio 12.1
This commit is contained in:
commit
d89dc2d5ad
@ -119,6 +119,16 @@
|
|||||||
|
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Oracle Solaris Studio
|
||||||
|
#ifdef __SUNPRO_CC
|
||||||
|
|
||||||
|
# if __SUNPRO_CC == 0x5100 // Oracle Solaris Studio version 12.1
|
||||||
|
# define CATCH_INTERNAL_SUNPRO_CC_NON_COMPLIANT_STL
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif // __SUNPRO_CC
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Use variadic macros if the compiler supports them
|
// Use variadic macros if the compiler supports them
|
||||||
|
@ -327,8 +327,9 @@ namespace Catch {
|
|||||||
void handleUnfinishedSections() {
|
void handleUnfinishedSections() {
|
||||||
// If sections ended prematurely due to an exception we stored their
|
// If sections ended prematurely due to an exception we stored their
|
||||||
// infos here so we can tear them down outside the unwind process.
|
// infos here so we can tear them down outside the unwind process.
|
||||||
for( std::vector<SectionEndInfo>::const_reverse_iterator it = m_unfinishedSections.rbegin(),
|
std::vector<SectionEndInfo> const& constUnfinishedSections = m_unfinishedSections;
|
||||||
itEnd = m_unfinishedSections.rend();
|
for( std::vector<SectionEndInfo>::const_reverse_iterator it = constUnfinishedSections.rbegin(),
|
||||||
|
itEnd = constUnfinishedSections.rend();
|
||||||
it != itEnd;
|
it != itEnd;
|
||||||
++it )
|
++it )
|
||||||
sectionEnded( *it );
|
sectionEnded( *it );
|
||||||
|
@ -48,7 +48,7 @@ namespace Catch {
|
|||||||
oss << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" << lineInfo;
|
oss << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" << lineInfo;
|
||||||
throw std::domain_error( oss.str().c_str() );
|
throw std::domain_error( oss.str().c_str() );
|
||||||
}
|
}
|
||||||
if( !m_registry.insert( std::make_pair( alias, TagAlias( tag, lineInfo ) ) ).second ) {
|
if( !m_registry.insert( std::make_pair( std::string(alias), TagAlias( tag, lineInfo ) ) ).second ) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << "error: tag alias, \"" << alias << "\" already registered.\n"
|
oss << "error: tag alias, \"" << alias << "\" already registered.\n"
|
||||||
<< "\tFirst seen at " << find(alias)->lineInfo << "\n"
|
<< "\tFirst seen at " << find(alias)->lineInfo << "\n"
|
||||||
|
@ -218,7 +218,12 @@ namespace Catch {
|
|||||||
|
|
||||||
// using messages.end() directly yields compilation error:
|
// using messages.end() directly yields compilation error:
|
||||||
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
std::vector<MessageInfo>::const_iterator itEnd = messages.end();
|
||||||
|
# ifdef CATCH_INTERNAL_SUNPRO_CC_NON_COMPLIANT_STL
|
||||||
|
std::size_t N;
|
||||||
|
std::distance( itMessage, itEnd, N );
|
||||||
|
# else
|
||||||
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
|
||||||
|
# endif // CATCH_INTERNAL_SUNPRO_CC_NON_COMPLIANT_STL
|
||||||
|
|
||||||
{
|
{
|
||||||
Colour colourGuard( colour );
|
Colour colourGuard( colour );
|
||||||
|
Loading…
Reference in New Issue
Block a user