Browse Source

Use _MSC_VER for MSVC-specific pragmas

These aren't used on mingw so they need to be surrounded by #ifdef
_MSC_VER
jp9000 10 years ago
parent
commit
6b38fa35b0

+ 2 - 0
plugins/obs-outputs/librtmp/rtmp.h

@@ -37,8 +37,10 @@
 #include <stdint.h>
 
 #ifdef _WIN32
+#ifdef _MSC_VER
 #pragma warning(disable:4996) //depricated warnings
 #pragma warning(disable:4244) //64bit defensive mechanism, fixed the ones that mattered
+#endif
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #else

+ 6 - 0
plugins/win-capture/d3d8-api/d3d8types.h

@@ -22,7 +22,11 @@
 #if _MSC_VER >= 1200
 #pragma warning(push)
 #endif
+
+#ifdef _MSC_VER
 #pragma warning(disable:4201) // anonymous unions warning
+#endif
+
 #if defined(_X86_) || defined(_IA64_)
 #pragma pack(4)
 #endif
@@ -1676,8 +1680,10 @@ typedef struct _D3DDEVINFO_D3DVERTEXSTATS
 #if _MSC_VER >= 1200
 #pragma warning(pop)
 #else
+#ifdef _MSC_VER
 #pragma warning(default:4201)
 #endif
+#endif
 
 #endif /* (DIRECT3D_VERSION >= 0x0800) */
 #endif /* _D3D8TYPES(P)_H_ */

+ 4 - 0
plugins/win-capture/graphics-hook/gl-capture.c

@@ -1,6 +1,10 @@
 #define _CRT_SECURE_NO_WARNINGS
+
+#ifdef _MSC_VER
 #pragma warning(disable : 4214) /* nonstandard extension, non-int bitfield */
 #pragma warning(disable : 4054) /* function pointer to data pointer */
+#endif
+
 #include <windows.h>
 
 #define COBJMACROS

+ 2 - 0
plugins/win-capture/graphics-hook/graphics-hook.h

@@ -1,7 +1,9 @@
 #pragma once
 
+#ifdef _MSC_VER
 /* conversion from data/function pointer */
 #pragma warning(disable: 4152)
+#endif
 
 #include "../graphics-hook-info.h"
 

+ 4 - 0
plugins/win-capture/obfuscate.c

@@ -1,5 +1,9 @@
 #define _CRT_SECURE_NO_WARNINGS
+
+#ifdef _MSC_VER
 #pragma warning(disable : 4152) /* casting func ptr to void */
+#endif
+
 #include <stdbool.h>
 #include <windows.h>
 #include "obfuscate.h"

+ 2 - 2
plugins/win-dshow/ffmpeg-decode.h

@@ -23,7 +23,7 @@ extern "C" {
 
 #include <obs.h>
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 #pragma warning(push)
 #pragma warning(disable : 4244)
 #pragma warning(disable : 4204)
@@ -32,7 +32,7 @@ extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavutil/log.h>
 
-#ifdef _WIN32
+#ifdef _MSC_VER
 #pragma warning(pop)
 #endif