mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-14 03:13:31 +08:00
Coding - Suppress macOS system header warnings in multiple files (#997)
- Added clang diagnostic pragmas to suppress three specific warning types around macOS/iOS framework imports - Added version-specific warning suppression for clang 20+ in the general warnings disable header - Extended function cast warning suppression to cover clang's `-Wcast-function-type-mismatch`
This commit is contained in:
@@ -24,11 +24,17 @@
|
||||
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
// Suppress warnings from macOS system headers
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
|
||||
#pragma clang diagnostic ignored "-Wavailability"
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <OpenGl_GlCore11.hxx>
|
||||
#include <OpenGl_Context.hxx>
|
||||
|
||||
@@ -24,17 +24,24 @@
|
||||
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
// Suppress warnings from macOS system headers
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
|
||||
#pragma clang diagnostic ignored "-Wavailability"
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE
|
||||
#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
|
||||
@interface NSView (LionAPI)
|
||||
- (NSSize )convertSizeToBacking: (NSSize )theSize;
|
||||
@end
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <OpenGl_Window.hxx>
|
||||
|
||||
@@ -17,11 +17,17 @@
|
||||
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
// Suppress warnings from macOS system headers
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
|
||||
#pragma clang diagnostic ignored "-Wavailability"
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#ifndef HAVE_OBJC_ARC
|
||||
|
||||
|
||||
@@ -15,11 +15,17 @@
|
||||
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
// Suppress warnings from macOS system headers
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
|
||||
#pragma clang diagnostic ignored "-Wavailability"
|
||||
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <Cocoa_Window.hxx>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user