Files
MINGW-packages/mingw-w64-qt3dstudio-git/0002-Use-pragma-directives-only-for-MSVC-builds.patch
2017-12-05 15:41:45 +03:00

134 lines
4.9 KiB
Diff

From 2fec00edb26b0b93cb58a9b0a0150b6cf48a347b Mon Sep 17 00:00:00 2001
From: Alexey Pavlov <alexpux@gmail.com>
Date: Tue, 5 Dec 2017 15:22:07 +0300
Subject: [PATCH] Use pragma directives only for MSVC builds
---
src/Authoring/Client/Code/Core/StdAfx.h | 10 +++++-----
src/Runtime/Source/Engine/Include/EnginePrefix.h | 4 +++-
src/Runtime/Source/Runtime/Include/RuntimePrefix.h | 4 +++-
src/Runtime/Source/System/Include/SystemPrefix.h | 4 +++-
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/Authoring/Client/Code/Core/StdAfx.h b/src/Authoring/Client/Code/Core/StdAfx.h
index cd9d3b8..5cb5150 100644
--- a/src/Authoring/Client/Code/Core/StdAfx.h
+++ b/src/Authoring/Client/Code/Core/StdAfx.h
@@ -33,7 +33,7 @@
#pragma once
#include "Qt3DSMacros.h"
-#ifdef _WIN32
+#ifdef _MSC_VER
//==============================================================================
// Disable certain warnings since warnings are errors
//==============================================================================
@@ -51,7 +51,7 @@
#include <float.h>
#include <math.h>
-#ifdef _WIN32
+#ifdef _MSC_VER
//==============================================================================
// Windows Includes
//==============================================================================
@@ -68,7 +68,7 @@
//==============================================================================
// STL Includes
//==============================================================================
-#ifdef _WIN32
+#ifdef _MSC_VER
#pragma warning(push, 3) // Temporarily pop to warning level 3 while including standard headers
#pragma warning(disable : 4018) // Disable mismatched < STL warning
#endif
@@ -83,7 +83,7 @@
#include <algorithm>
#include <stdexcept>
#include <limits>
-#ifdef _WIN32
+#ifdef _MSC_VER
#pragma warning(pop) // Pop out to previous warning level (probably level 4)
#endif
@@ -120,7 +120,7 @@
#include <QtGlobal>
-#ifdef _WIN32
+#ifdef _MSC_VER
#pragma warning(disable : 4100) // unreferenced formal parameter
#pragma warning(disable : 4127) // conditional expression is constant
#pragma warning(disable : 4189) // local variable is initialized but not referenced
diff --git a/src/Runtime/Source/Engine/Include/EnginePrefix.h b/src/Runtime/Source/Engine/Include/EnginePrefix.h
index 32858ae..31f7658 100644
--- a/src/Runtime/Source/Engine/Include/EnginePrefix.h
+++ b/src/Runtime/Source/Engine/Include/EnginePrefix.h
@@ -36,7 +36,9 @@
//==============================================================================
// DEFINES
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#endif //_WIN32
+#ifdef _MSC_VER
//==============================================================================
// DISABLED WARNINGS
//
@@ -67,7 +69,7 @@
#pragma warning(disable : 4826) // Conversion from 'const void *' to 'void *' is sign-extended
//#pragma warning( disable : 4996 ) // _snprintf' was declared deprecated
-#endif //_WIN32
+#endif //_MSC_VER
//==============================================================================
// Non-windows environments need to declare this
diff --git a/src/Runtime/Source/Runtime/Include/RuntimePrefix.h b/src/Runtime/Source/Runtime/Include/RuntimePrefix.h
index bf729eb..a7292f3 100644
--- a/src/Runtime/Source/Runtime/Include/RuntimePrefix.h
+++ b/src/Runtime/Source/Runtime/Include/RuntimePrefix.h
@@ -32,7 +32,7 @@
#include "render/backends/gl/Qt3DSOpenGLPrefix.h"
-#ifdef _WIN32
+#ifdef _MSC_VER
//==============================================================================
// DISABLED WARNINGS
//
@@ -63,7 +63,9 @@
#pragma warning(disable : 4640) // construction of local static object is not thread-safe
#pragma warning(disable : 4127) // conditional expression is constant
+#endif //_MSC_VER
+#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif //_WIN32
diff --git a/src/Runtime/Source/System/Include/SystemPrefix.h b/src/Runtime/Source/System/Include/SystemPrefix.h
index aa1ba18..9f02565 100644
--- a/src/Runtime/Source/System/Include/SystemPrefix.h
+++ b/src/Runtime/Source/System/Include/SystemPrefix.h
@@ -34,7 +34,9 @@
//==============================================================================
// DEFINES
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#endif //_WIN32
+#ifdef _MSC_VER
//==============================================================================
// DISABLED WARNINGS
//
@@ -63,7 +65,7 @@
#pragma warning(disable : 4127) // conditional expression is constant
#pragma warning( \
disable : 4738) // storing 32-bit float result in memory, possible loss of performance
-#endif //_WIN32
+#endif //_MSC_VER
//==============================================================================
// STD INCLUDES - Standard includes MUST come first
--
2.15.0