mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Conditionally compile clang pragmas
This commit is contained in:
		@@ -9,8 +9,10 @@
 | 
			
		||||
// Collect all the implementation files together here
 | 
			
		||||
// These are the equivalent of what would usually be cpp files
 | 
			
		||||
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#pragma clang diagnostic push
 | 
			
		||||
#pragma clang diagnostic ignored "-Wweak-vtables"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "catch_runner.hpp"
 | 
			
		||||
#include "catch_registry_hub.hpp"
 | 
			
		||||
@@ -52,4 +54,6 @@ namespace Catch {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#pragma clang diagnostic pop
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -33,11 +33,15 @@ inline id performOptionalSelector( id obj, SEL sel ) {
 | 
			
		||||
#else
 | 
			
		||||
inline void arcSafeRelease( NSObject* ){}
 | 
			
		||||
inline id performOptionalSelector( id obj, SEL sel ) {
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#pragma clang diagnostic push
 | 
			
		||||
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
 | 
			
		||||
#endif
 | 
			
		||||
    if( [obj respondsToSelector: sel] )
 | 
			
		||||
        return [obj performSelector: sel];
 | 
			
		||||
#ifdef __clang__
 | 
			
		||||
#pragma clang diagnostic pop
 | 
			
		||||
#endif
 | 
			
		||||
    return nil;
 | 
			
		||||
}
 | 
			
		||||
#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user