mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Added std:: qualification to some functions from C stdlib
This should solve #543, once Clara changes are in as well.
This commit is contained in:
		| @@ -50,7 +50,7 @@ namespace Detail { | ||||
|         friend bool operator == ( const T& lhs, Approx const& rhs ) { | ||||
|             // Thanks to Richard Harris for his help refining this formula | ||||
|             auto lhs_v = double(lhs); | ||||
|             return fabs( lhs_v - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs_v), fabs(rhs.m_value) ) ); | ||||
|             return std::fabs( lhs_v - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs_v), std::fabs(rhs.m_value) ) ); | ||||
|         } | ||||
|  | ||||
|         template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type> | ||||
| @@ -94,7 +94,7 @@ namespace Detail { | ||||
| #else | ||||
|         friend bool operator == ( double lhs, Approx const& rhs ) { | ||||
|             // Thanks to Richard Harris for his help refining this formula | ||||
|             return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) ); | ||||
|             return std::fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( std::fabs(lhs), std::fabs(rhs.m_value) ) ); | ||||
|         } | ||||
|  | ||||
|         friend bool operator == ( Approx const& lhs, double rhs ) { | ||||
|   | ||||
| @@ -24,6 +24,7 @@ | ||||
| #include <sstream> | ||||
| #include <stdexcept> | ||||
| #include <algorithm> | ||||
| #include <cctype> | ||||
|  | ||||
| #include "catch_compiler_capabilities.h" | ||||
|  | ||||
|   | ||||
| @@ -33,7 +33,7 @@ namespace Catch { | ||||
|         return s.find(infix) != std::string::npos; | ||||
|     } | ||||
|     char toLowerCh(char c) { | ||||
|         return static_cast<char>( ::tolower( c ) ); | ||||
|         return static_cast<char>( std::tolower( c ) ); | ||||
|     } | ||||
|     void toLowerInPlace( std::string& s ) { | ||||
|         std::transform( s.begin(), s.end(), s.begin(), toLowerCh ); | ||||
|   | ||||
| @@ -32,7 +32,7 @@ namespace Catch { | ||||
|             return TestCaseInfo::None; | ||||
|     } | ||||
|     inline bool isReservedTag( std::string const& tag ) { | ||||
|         return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] ); | ||||
|         return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( tag[0] ); | ||||
|     } | ||||
|     inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) { | ||||
|         if( isReservedTag( tag ) ) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský