mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Simplify how warnings are ignored on Apple platforms
Within files that are only compiled on Apple platforms, we don't need that redundant check for __APPLE__ so that got removed. Further, Clang will recognize GCC pragmas so we don't need both Clang AND GCC pragmas so I removed the Clang pragmas. Currently GCC fails to compile this code but if one day in the future that gets fixed, the deprecation warnings will continue to get ignored.
This commit is contained in:
parent
49fd5887c8
commit
a71d60a0c9
@ -32,13 +32,7 @@
|
||||
#define GREEN @"Green"
|
||||
#define RED @"Red"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Our PIMPL
|
||||
struct SFMLmainWindow
|
||||
|
@ -33,12 +33,8 @@
|
||||
#include <utility>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -33,14 +33,9 @@
|
||||
#include <filesystem>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <al.h>
|
||||
#include <alc.h>
|
||||
@ -100,9 +95,5 @@ ALenum alGetLastErrorImpl();
|
||||
#endif // SFML_ALCHECK_HPP
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
@ -34,12 +34,8 @@
|
||||
#include <ostream>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -36,12 +36,8 @@
|
||||
#include <ostream>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -30,12 +30,8 @@
|
||||
#include <SFML/Audio/SoundBuffer.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -38,12 +38,8 @@
|
||||
#include <ostream>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -40,12 +40,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -29,12 +29,8 @@
|
||||
#include <SFML/Audio/SoundSource.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -40,12 +40,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -30,9 +30,7 @@
|
||||
|
||||
#include <android/looper.h>
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
|
@ -109,8 +109,8 @@ bool CursorImpl::loadFromSystem(Cursor::Type type)
|
||||
case Cursor::SizeBottom: newCursor = [NSCursor resizeUpDownCursor]; break;
|
||||
|
||||
// These cursor types are undocumented, may not be available on some platforms
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wundeclared-selector"
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wundeclared-selector"
|
||||
case Cursor::SizeTopRight:
|
||||
case Cursor::SizeBottomLeft:
|
||||
case Cursor::SizeBottomLeftTopRight:
|
||||
@ -126,7 +126,7 @@ bool CursorImpl::loadFromSystem(Cursor::Type type)
|
||||
case Cursor::Help:
|
||||
newCursor = loadFromSelector(@selector(_helpCursor));
|
||||
break;
|
||||
#pragma clang diagnostic pop
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
|
@ -28,13 +28,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#import <SFML/Window/OSX/SFApplication.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -28,13 +28,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#import <SFML/Window/OSX/SFApplicationDelegate.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@implementation SFApplicationDelegate
|
||||
|
@ -35,13 +35,7 @@
|
||||
#include <ostream>
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -29,13 +29,7 @@
|
||||
#import <SFML/Window/OSX/SFKeyboardModifiersHelper.h>
|
||||
#include <SFML/Window/OSX/WindowImplCocoa.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -31,13 +31,7 @@
|
||||
#import <SFML/Window/OSX/SFOpenGLView+keyboard_priv.h>
|
||||
#include <SFML/Window/OSX/WindowImplCocoa.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// In this file, we implement keyboard handling for SFOpenGLView
|
||||
|
@ -32,13 +32,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -28,15 +28,8 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
@ -212,10 +205,4 @@ class WindowImplCocoa;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
@ -32,13 +32,7 @@
|
||||
#import <SFML/Window/OSX/SFSilentResponder.h>
|
||||
#include <SFML/Window/OSX/WindowImplCocoa.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
@ -34,13 +34,7 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@implementation SFViewController
|
||||
|
||||
|
@ -43,13 +43,7 @@
|
||||
#include <algorithm>
|
||||
#include <ostream>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// SFBlackView is a simple view filled with black, nothing more
|
||||
|
@ -32,15 +32,8 @@
|
||||
#include <SFML/Window/Event.hpp>
|
||||
#include <SFML/Window/WindowImpl.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Predefine OBJ-C classes
|
||||
@ -379,12 +372,6 @@ private:
|
||||
|
||||
} // namespace sf
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // SFML_WINDOWIMPLCOCOA_HPP
|
||||
|
@ -32,15 +32,8 @@
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
@ -246,10 +239,4 @@ class WindowImplCocoa;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
@ -30,13 +30,7 @@
|
||||
#import <SFML/Window/OSX/Scaling.h>
|
||||
#include <SFML/Window/OSX/cg_sf_conversion.hpp>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
|
@ -35,15 +35,8 @@
|
||||
|
||||
#include <glad/gl.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SFML_DECLARE_OBJC_CLASS(EAGLContext);
|
||||
SFML_DECLARE_OBJC_CLASS(SFView);
|
||||
@ -178,12 +171,6 @@ private:
|
||||
|
||||
} // namespace sf
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // SFML_EAGLCONTEXT_HPP
|
||||
|
@ -39,13 +39,7 @@
|
||||
#include <ostream>
|
||||
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
namespace
|
||||
|
@ -176,25 +176,12 @@ std::vector<sf::Vector2i> touchPositions;
|
||||
if (!self.sfWindow)
|
||||
return false;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wold-style-cast"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
UIViewController* rootViewController = [((__bridge UIWindow*)(self.sfWindow->getSystemHandle())) rootViewController];
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!rootViewController || ![rootViewController shouldAutorotate])
|
||||
return false;
|
||||
|
@ -32,13 +32,7 @@
|
||||
#include <QuartzCore/CAEAGLLayer.h>
|
||||
#include <cstring>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@interface SFView ()
|
||||
|
||||
|
@ -34,13 +34,7 @@
|
||||
|
||||
#include <UIKit/UIKit.h>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace sf
|
||||
{
|
||||
@ -109,25 +103,12 @@ void WindowImplUIKit::processEvents()
|
||||
////////////////////////////////////////////////////////////
|
||||
WindowHandle WindowImplUIKit::getSystemHandle() const
|
||||
{
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wold-style-cast"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return (__bridge WindowHandle)m_window;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user