diff --git a/.clang-format b/.clang-format index 2ed0c10b..15d650fe 100644 --- a/.clang-format +++ b/.clang-format @@ -20,6 +20,8 @@ NamespaceIndentation: All # Includes #IncludeBlocks: Regroup IncludeCategories: + - Regex: '^"warning-disable.hpp"$' + Priority: 50 - Regex: '^(<|")(config.hpp|common.hpp|ui-common.hpp|strings.hpp|version.hpp|obs.h)("|>)' Priority: 100 - Regex: '^ #include @@ -44,6 +46,8 @@ #include #include +#include "warning-enable.hpp" + // Common Plugin includes #include "config.hpp" #include "strings.hpp" @@ -56,17 +60,8 @@ #include "util/utility.hpp" // Common OBS includes +#include "warning-disable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif #include #include @@ -85,15 +80,11 @@ extern "C" { #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif // Fix libOBS's global defines #undef strtoll } +#include "warning-enable.hpp" // Common Global defines /// Logging diff --git a/source/configuration.hpp b/source/configuration.hpp index d199ad94..5b9f1b77 100644 --- a/source/configuration.hpp +++ b/source/configuration.hpp @@ -19,8 +19,11 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" namespace streamfx { class configuration { diff --git a/source/encoders/encoder-aom-av1.cpp b/source/encoders/encoder-aom-av1.cpp index d85f6284..dd33bb36 100644 --- a/source/encoders/encoder-aom-av1.cpp +++ b/source/encoders/encoder-aom-av1.cpp @@ -23,9 +23,12 @@ //--------------------------------------------------------------------------------// #include "encoder-aom-av1.hpp" +#include "util/util-logging.hpp" + +#include "warning-disable.hpp" #include #include -#include "util/util-logging.hpp" +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " diff --git a/source/encoders/encoder-aom-av1.hpp b/source/encoders/encoder-aom-av1.hpp index fba31a70..1effe183 100644 --- a/source/encoders/encoder-aom-av1.hpp +++ b/source/encoders/encoder-aom-av1.hpp @@ -24,30 +24,20 @@ #pragma once #include "common.hpp" -#include -#include #include "encoders/codecs/av1.hpp" #include "obs/obs-encoder-factory.hpp" #include "util/util-library.hpp" #include "util/util-profiler.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" }; namespace streamfx::encoder::aom::av1 { diff --git a/source/encoders/encoder-ffmpeg.cpp b/source/encoders/encoder-ffmpeg.cpp index a47da31f..2da6e71a 100644 --- a/source/encoders/encoder-ffmpeg.cpp +++ b/source/encoders/encoder-ffmpeg.cpp @@ -21,13 +21,30 @@ #include "encoder-ffmpeg.hpp" #include "strings.hpp" -#include #include "codecs/hevc.hpp" #include "ffmpeg/tools.hpp" #include "handlers/debug_handler.hpp" #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + +extern "C" { +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + +#include "warning-disable.hpp" +#include +#include +#include +#include +#include +#include "warning-enable.hpp" +} + #ifdef ENABLE_ENCODER_FFMPEG_AMF #include "handlers/amf_h264_handler.hpp" #include "handlers/amf_hevc_handler.hpp" @@ -46,46 +63,6 @@ #include "handlers/dnxhd_handler.hpp" #endif -extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif -#include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif -#include -#include -#include -#include -#include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif -} - #ifdef WIN32 #include "ffmpeg/hwapi/d3d11.hpp" #endif diff --git a/source/encoders/encoder-ffmpeg.hpp b/source/encoders/encoder-ffmpeg.hpp index ac7659e7..bd0a5d78 100644 --- a/source/encoders/encoder-ffmpeg.hpp +++ b/source/encoders/encoder-ffmpeg.hpp @@ -21,6 +21,13 @@ #pragma once #include "common.hpp" +#include "ffmpeg/avframe-queue.hpp" +#include "ffmpeg/hwapi/base.hpp" +#include "ffmpeg/swscale.hpp" +#include "handlers/handler.hpp" +#include "obs/obs-encoder-factory.hpp" + +#include "warning-disable.hpp" #include #include #include @@ -28,27 +35,13 @@ #include #include #include -#include "ffmpeg/avframe-queue.hpp" -#include "ffmpeg/hwapi/base.hpp" -#include "ffmpeg/swscale.hpp" -#include "handlers/handler.hpp" -#include "obs/obs-encoder-factory.hpp" +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg { diff --git a/source/encoders/handlers/amf_h264_handler.cpp b/source/encoders/handlers/amf_h264_handler.cpp index 838bac1f..9a2385b5 100644 --- a/source/encoders/handlers/amf_h264_handler.cpp +++ b/source/encoders/handlers/amf_h264_handler.cpp @@ -28,22 +28,9 @@ #include "ffmpeg/tools.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } // Settings diff --git a/source/encoders/handlers/amf_h264_handler.hpp b/source/encoders/handlers/amf_h264_handler.hpp index a6a0104a..3a464837 100644 --- a/source/encoders/handlers/amf_h264_handler.hpp +++ b/source/encoders/handlers/amf_h264_handler.hpp @@ -26,22 +26,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/encoders/handlers/amf_hevc_handler.cpp b/source/encoders/handlers/amf_hevc_handler.cpp index 44a8f6ec..e586abd8 100644 --- a/source/encoders/handlers/amf_hevc_handler.cpp +++ b/source/encoders/handlers/amf_hevc_handler.cpp @@ -31,19 +31,9 @@ #include "plugin.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } // Settings diff --git a/source/encoders/handlers/amf_hevc_handler.hpp b/source/encoders/handlers/amf_hevc_handler.hpp index cb87b4c9..36988552 100644 --- a/source/encoders/handlers/amf_hevc_handler.hpp +++ b/source/encoders/handlers/amf_hevc_handler.hpp @@ -25,22 +25,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/encoders/handlers/amf_shared.cpp b/source/encoders/handlers/amf_shared.cpp index df78e900..071dd270 100644 --- a/source/encoders/handlers/amf_shared.cpp +++ b/source/encoders/handlers/amf_shared.cpp @@ -27,22 +27,9 @@ #include "ffmpeg/tools.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } // Translation diff --git a/source/encoders/handlers/amf_shared.hpp b/source/encoders/handlers/amf_shared.hpp index a2cc5b73..059c515a 100644 --- a/source/encoders/handlers/amf_shared.hpp +++ b/source/encoders/handlers/amf_shared.hpp @@ -26,22 +26,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler::amf { diff --git a/source/encoders/handlers/debug_handler.cpp b/source/encoders/handlers/debug_handler.cpp index f3588b70..de58e671 100644 --- a/source/encoders/handlers/debug_handler.cpp +++ b/source/encoders/handlers/debug_handler.cpp @@ -21,30 +21,20 @@ #include "debug_handler.hpp" #include "common.hpp" +#include "handler.hpp" +#include "plugin.hpp" + +#include "warning-disable.hpp" #include #include #include #include -#include "handler.hpp" -#include "plugin.hpp" +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } using namespace streamfx::encoder::ffmpeg::handler; diff --git a/source/encoders/handlers/dnxhd_handler.cpp b/source/encoders/handlers/dnxhd_handler.cpp index c00e03e4..af48d3a1 100644 --- a/source/encoders/handlers/dnxhd_handler.cpp +++ b/source/encoders/handlers/dnxhd_handler.cpp @@ -1,10 +1,13 @@ #include "dnxhd_handler.hpp" #include "common.hpp" -#include #include "../codecs/dnxhr.hpp" #include "ffmpeg/tools.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + using namespace streamfx::encoder::ffmpeg::handler; using namespace streamfx::encoder::codec::dnxhr; diff --git a/source/encoders/handlers/dnxhd_handler.hpp b/source/encoders/handlers/dnxhd_handler.hpp index d6a6a5c8..49a6ad44 100644 --- a/source/encoders/handlers/dnxhd_handler.hpp +++ b/source/encoders/handlers/dnxhd_handler.hpp @@ -24,22 +24,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/encoders/handlers/handler.hpp b/source/encoders/handlers/handler.hpp index 02e82d75..aec41681 100644 --- a/source/encoders/handlers/handler.hpp +++ b/source/encoders/handlers/handler.hpp @@ -24,22 +24,9 @@ #include "ffmpeg/hwapi/base.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg { diff --git a/source/encoders/handlers/nvenc_h264_handler.cpp b/source/encoders/handlers/nvenc_h264_handler.cpp index fd3e789e..90669927 100644 --- a/source/encoders/handlers/nvenc_h264_handler.cpp +++ b/source/encoders/handlers/nvenc_h264_handler.cpp @@ -29,22 +29,9 @@ #include "plugin.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } #define ST_KEY_PROFILE "H264.Profile" diff --git a/source/encoders/handlers/nvenc_h264_handler.hpp b/source/encoders/handlers/nvenc_h264_handler.hpp index ec8d96cf..f8b46fec 100644 --- a/source/encoders/handlers/nvenc_h264_handler.hpp +++ b/source/encoders/handlers/nvenc_h264_handler.hpp @@ -23,22 +23,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/encoders/handlers/nvenc_hevc_handler.cpp b/source/encoders/handlers/nvenc_hevc_handler.cpp index d6c08577..a7aa85b1 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.cpp +++ b/source/encoders/handlers/nvenc_hevc_handler.cpp @@ -29,22 +29,9 @@ #include "plugin.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } #define ST_KEY_PROFILE "H265.Profile" diff --git a/source/encoders/handlers/nvenc_hevc_handler.hpp b/source/encoders/handlers/nvenc_hevc_handler.hpp index ee65fddf..a0fef6d7 100644 --- a/source/encoders/handlers/nvenc_hevc_handler.hpp +++ b/source/encoders/handlers/nvenc_hevc_handler.hpp @@ -23,22 +23,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/encoders/handlers/nvenc_shared.cpp b/source/encoders/handlers/nvenc_shared.cpp index 8979363c..3004a2d4 100644 --- a/source/encoders/handlers/nvenc_shared.cpp +++ b/source/encoders/handlers/nvenc_shared.cpp @@ -24,22 +24,9 @@ #include "ffmpeg/tools.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } #define ST_I18N_PRESET "Encoder.FFmpeg.NVENC.Preset" diff --git a/source/encoders/handlers/nvenc_shared.hpp b/source/encoders/handlers/nvenc_shared.hpp index 08288b27..535e8a1b 100644 --- a/source/encoders/handlers/nvenc_shared.hpp +++ b/source/encoders/handlers/nvenc_shared.hpp @@ -24,14 +24,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4242 4244 4365) -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#endif +#include "warning-enable.hpp" } /* NVENC has multiple compression modes: diff --git a/source/encoders/handlers/prores_aw_handler.cpp b/source/encoders/handlers/prores_aw_handler.cpp index 0cba86e0..13d4ee88 100644 --- a/source/encoders/handlers/prores_aw_handler.cpp +++ b/source/encoders/handlers/prores_aw_handler.cpp @@ -21,11 +21,14 @@ #include "prores_aw_handler.hpp" #include "common.hpp" -#include #include "../codecs/prores.hpp" #include "ffmpeg/tools.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + using namespace streamfx::encoder::ffmpeg::handler; using namespace streamfx::encoder::codec::prores; diff --git a/source/encoders/handlers/prores_aw_handler.hpp b/source/encoders/handlers/prores_aw_handler.hpp index 01d1ea63..caffa1d6 100644 --- a/source/encoders/handlers/prores_aw_handler.hpp +++ b/source/encoders/handlers/prores_aw_handler.hpp @@ -23,22 +23,9 @@ #include "handler.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::encoder::ffmpeg::handler { diff --git a/source/ffmpeg/avframe-queue.hpp b/source/ffmpeg/avframe-queue.hpp index 2a04dd20..2a5703ad 100644 --- a/source/ffmpeg/avframe-queue.hpp +++ b/source/ffmpeg/avframe-queue.hpp @@ -21,23 +21,16 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::ffmpeg { diff --git a/source/ffmpeg/hwapi/base.hpp b/source/ffmpeg/hwapi/base.hpp index 7c4adfe8..0ebec171 100644 --- a/source/ffmpeg/hwapi/base.hpp +++ b/source/ffmpeg/hwapi/base.hpp @@ -21,24 +21,17 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::ffmpeg::hwapi { diff --git a/source/ffmpeg/hwapi/d3d11.cpp b/source/ffmpeg/hwapi/d3d11.cpp index 0ba660c2..16b6677b 100644 --- a/source/ffmpeg/hwapi/d3d11.cpp +++ b/source/ffmpeg/hwapi/d3d11.cpp @@ -22,24 +22,17 @@ #ifdef WIN32 #include "d3d11.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } using namespace streamfx::ffmpeg::hwapi; diff --git a/source/ffmpeg/hwapi/d3d11.hpp b/source/ffmpeg/hwapi/d3d11.hpp index ef0e0201..b7b36f89 100644 --- a/source/ffmpeg/hwapi/d3d11.hpp +++ b/source/ffmpeg/hwapi/d3d11.hpp @@ -22,22 +22,12 @@ #pragma once #include "base.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" namespace streamfx::ffmpeg::hwapi { class d3d11 : public streamfx::ffmpeg::hwapi::base { diff --git a/source/ffmpeg/swscale.cpp b/source/ffmpeg/swscale.cpp index 73ded2aa..9a47e01d 100644 --- a/source/ffmpeg/swscale.cpp +++ b/source/ffmpeg/swscale.cpp @@ -20,7 +20,10 @@ // SOFTWARE. #include "swscale.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" using namespace streamfx::ffmpeg; diff --git a/source/ffmpeg/swscale.hpp b/source/ffmpeg/swscale.hpp index 30124a04..5d5fcfab 100644 --- a/source/ffmpeg/swscale.hpp +++ b/source/ffmpeg/swscale.hpp @@ -21,23 +21,16 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::ffmpeg { diff --git a/source/ffmpeg/tools.cpp b/source/ffmpeg/tools.cpp index 307fd02c..9b75b654 100644 --- a/source/ffmpeg/tools.cpp +++ b/source/ffmpeg/tools.cpp @@ -20,27 +20,20 @@ // SOFTWARE. #include "tools.hpp" -#include -#include #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } using namespace streamfx::ffmpeg; diff --git a/source/ffmpeg/tools.hpp b/source/ffmpeg/tools.hpp index 9ae3d7b1..13de717c 100644 --- a/source/ffmpeg/tools.hpp +++ b/source/ffmpeg/tools.hpp @@ -21,24 +21,17 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::ffmpeg::tools { diff --git a/source/filters/filter-autoframing.hpp b/source/filters/filter-autoframing.hpp index 71ef06da..29ee24ff 100644 --- a/source/filters/filter-autoframing.hpp +++ b/source/filters/filter-autoframing.hpp @@ -18,10 +18,6 @@ */ #pragma once -#include -#include -#include -#include #include "gfx/gfx-debug.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" @@ -31,6 +27,13 @@ #include "util/util-threadpool.hpp" #include "util/utility.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include +#include "warning-enable.hpp" + #ifdef ENABLE_FILTER_AUTOFRAMING_NVIDIA #include "nvidia/ar/nvidia-ar-facedetection.hpp" #endif diff --git a/source/filters/filter-blur.cpp b/source/filters/filter-blur.cpp index 5156f217..4250585d 100644 --- a/source/filters/filter-blur.cpp +++ b/source/filters/filter-blur.cpp @@ -19,11 +19,6 @@ #include "filter-blur.hpp" #include "strings.hpp" -#include -#include -#include -#include -#include #include "gfx/blur/gfx-blur-box-linear.hpp" #include "gfx/blur/gfx-blur-box.hpp" #include "gfx/blur/gfx-blur-dual-filtering.hpp" @@ -33,6 +28,22 @@ #include "obs/obs-source-tracker.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include +#include +#include "warning-enable.hpp" + +// OBS +#include "warning-disable.hpp" +#include +#include +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -47,19 +58,6 @@ #define D_LOG_DEBUG(...) P_LOG_DEBUG(ST_PREFIX __VA_ARGS__) #endif -// OBS -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4201) -#endif -#include -#include -#include -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif - // Translation Strings #define ST_I18N "Filter.Blur" diff --git a/source/filters/filter-blur.hpp b/source/filters/filter-blur.hpp index da5bdeec..f2ee74f9 100644 --- a/source/filters/filter-blur.hpp +++ b/source/filters/filter-blur.hpp @@ -19,10 +19,6 @@ #pragma once #include "common.hpp" -#include -#include -#include -#include #include "gfx/blur/gfx-blur-base.hpp" #include "gfx/gfx-source-texture.hpp" #include "obs/gs/gs-effect.hpp" @@ -31,6 +27,13 @@ #include "obs/gs/gs-texture.hpp" #include "obs/obs-source-factory.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include +#include "warning-enable.hpp" + namespace streamfx::filter::blur { enum class mask_type : int64_t { Region, diff --git a/source/filters/filter-color-grade.cpp b/source/filters/filter-color-grade.cpp index 4a190366..34f23986 100644 --- a/source/filters/filter-color-grade.cpp +++ b/source/filters/filter-color-grade.cpp @@ -19,10 +19,22 @@ #include "filter-color-grade.hpp" #include "strings.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + +// OBS +#include "warning-disable.hpp" +extern "C" { +#include +#include +#include +} +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -37,18 +49,6 @@ #define D_LOG_DEBUG(...) P_LOG_DEBUG(ST_PREFIX __VA_ARGS__) #endif -// OBS -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4201) -#endif -#include -#include -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #define ST_I18N "Filter.ColorGrade" // Lift #define ST_KEY_LIFT "Filter.ColorGrade.Lift" diff --git a/source/filters/filter-color-grade.hpp b/source/filters/filter-color-grade.hpp index a9b1c4f1..fcdc887d 100644 --- a/source/filters/filter-color-grade.hpp +++ b/source/filters/filter-color-grade.hpp @@ -18,7 +18,6 @@ */ #pragma once -#include #include "gfx/lut/gfx-lut-consumer.hpp" #include "gfx/lut/gfx-lut-producer.hpp" #include "gfx/lut/gfx-lut.hpp" @@ -29,6 +28,10 @@ #include "obs/obs-source-factory.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::filter::color_grade { enum class detection_mode { HSV, diff --git a/source/filters/filter-denoising.cpp b/source/filters/filter-denoising.cpp index 94c11d7d..73e3a7e0 100644 --- a/source/filters/filter-denoising.cpp +++ b/source/filters/filter-denoising.cpp @@ -19,11 +19,14 @@ // SOFTWARE. #include "filter-denoising.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-denoising.hpp b/source/filters/filter-denoising.hpp index b1e46ce3..a524e6a9 100644 --- a/source/filters/filter-denoising.hpp +++ b/source/filters/filter-denoising.hpp @@ -19,9 +19,6 @@ // SOFTWARE. #pragma once -#include -#include -#include #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" @@ -29,6 +26,12 @@ #include "plugin.hpp" #include "util/util-threadpool.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #ifdef ENABLE_FILTER_DENOISING_NVIDIA #include "nvidia/vfx/nvidia-vfx-denoising.hpp" #endif diff --git a/source/filters/filter-displacement.cpp b/source/filters/filter-displacement.cpp index 92fa8003..d1745ac4 100644 --- a/source/filters/filter-displacement.cpp +++ b/source/filters/filter-displacement.cpp @@ -23,11 +23,14 @@ #include "filter-displacement.hpp" #include "strings.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-dynamic-mask.cpp b/source/filters/filter-dynamic-mask.cpp index 31068be2..51156dc3 100644 --- a/source/filters/filter-dynamic-mask.cpp +++ b/source/filters/filter-dynamic-mask.cpp @@ -19,11 +19,14 @@ #include "filter-dynamic-mask.hpp" #include "strings.hpp" +#include "obs/gs/gs-helper.hpp" +#include "util/util-logging.hpp" + +#include "warning-disable.hpp" #include #include #include -#include "obs/gs/gs-helper.hpp" -#include "util/util-logging.hpp" +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " diff --git a/source/filters/filter-dynamic-mask.hpp b/source/filters/filter-dynamic-mask.hpp index 3b936aec..60c7b3c3 100644 --- a/source/filters/filter-dynamic-mask.hpp +++ b/source/filters/filter-dynamic-mask.hpp @@ -19,8 +19,6 @@ #pragma once #include "common.hpp" -#include -#include #include "gfx/gfx-source-texture.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/obs-source-active-reference.hpp" @@ -30,6 +28,11 @@ #include "obs/obs-source.hpp" #include "obs/obs-tools.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::filter::dynamic_mask { enum class channel : int8_t { Invalid = -1, Red, Green, Blue, Alpha }; diff --git a/source/filters/filter-sdf-effects.cpp b/source/filters/filter-sdf-effects.cpp index 9b468f51..3b73af7f 100644 --- a/source/filters/filter-sdf-effects.cpp +++ b/source/filters/filter-sdf-effects.cpp @@ -19,10 +19,13 @@ #include "filter-sdf-effects.hpp" #include "strings.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-shader.cpp b/source/filters/filter-shader.cpp index 77e8dabe..7ad26055 100644 --- a/source/filters/filter-shader.cpp +++ b/source/filters/filter-shader.cpp @@ -19,10 +19,13 @@ #include "filter-shader.hpp" #include "strings.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-transform.cpp b/source/filters/filter-transform.cpp index cf1cb682..b45f9e43 100644 --- a/source/filters/filter-transform.cpp +++ b/source/filters/filter-transform.cpp @@ -19,11 +19,21 @@ #include "filter-transform.hpp" #include "strings.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + +// OBS +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -38,18 +48,6 @@ #define D_LOG_DEBUG(...) P_LOG_DEBUG(ST_PREFIX __VA_ARGS__) #endif -// OBS -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4201) -#endif -#include -#include -#include -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #define ST_I18N "Filter.Transform" #define ST_I18N_CAMERA ST_I18N ".Camera" #define ST_I18N_CAMERA_MODE ST_I18N_CAMERA ".Mode" diff --git a/source/filters/filter-transform.hpp b/source/filters/filter-transform.hpp index ec79898a..3d3f46b0 100644 --- a/source/filters/filter-transform.hpp +++ b/source/filters/filter-transform.hpp @@ -19,13 +19,16 @@ #pragma once #include "common.hpp" -#include #include "obs/gs/gs-mipmapper.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-vertexbuffer.hpp" #include "obs/obs-source-factory.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::filter::transform { enum class transform_mode { ORTHOGRAPHIC = 0, diff --git a/source/filters/filter-upscaling.cpp b/source/filters/filter-upscaling.cpp index 610a96ac..8ec6b788 100644 --- a/source/filters/filter-upscaling.cpp +++ b/source/filters/filter-upscaling.cpp @@ -19,11 +19,14 @@ // SOFTWARE. #include "filter-upscaling.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-upscaling.hpp b/source/filters/filter-upscaling.hpp index 564016d1..35932bde 100644 --- a/source/filters/filter-upscaling.hpp +++ b/source/filters/filter-upscaling.hpp @@ -19,9 +19,6 @@ // SOFTWARE. #pragma once -#include -#include -#include #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" @@ -29,6 +26,12 @@ #include "plugin.hpp" #include "util/util-threadpool.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #ifdef ENABLE_FILTER_UPSCALING_NVIDIA #include "nvidia/vfx/nvidia-vfx-superresolution.hpp" #endif diff --git a/source/filters/filter-virtual-greenscreen.cpp b/source/filters/filter-virtual-greenscreen.cpp index 32d8f541..62fb96f6 100644 --- a/source/filters/filter-virtual-greenscreen.cpp +++ b/source/filters/filter-virtual-greenscreen.cpp @@ -19,11 +19,14 @@ // SOFTWARE. #include "filter-virtual-greenscreen.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/filters/filter-virtual-greenscreen.hpp b/source/filters/filter-virtual-greenscreen.hpp index a2c5275f..c170add7 100644 --- a/source/filters/filter-virtual-greenscreen.hpp +++ b/source/filters/filter-virtual-greenscreen.hpp @@ -19,9 +19,6 @@ // SOFTWARE. #pragma once -#include -#include -#include #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" @@ -29,6 +26,12 @@ #include "plugin.hpp" #include "util/util-threadpool.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #ifdef ENABLE_FILTER_VIRTUAL_GREENSCREEN_NVIDIA #include "nvidia/vfx/nvidia-vfx-greenscreen.hpp" #endif diff --git a/source/gfx/blur/gfx-blur-base.cpp b/source/gfx/blur/gfx-blur-base.cpp index ca0dcd99..74817e5e 100644 --- a/source/gfx/blur/gfx-blur-base.cpp +++ b/source/gfx/blur/gfx-blur-base.cpp @@ -16,7 +16,10 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-blur-base.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" void streamfx::gfx::blur::base::set_step_scale_x(double_t v) { diff --git a/source/gfx/blur/gfx-blur-box-linear.cpp b/source/gfx/blur/gfx-blur-box-linear.cpp index c2f787cd..59f5306a 100644 --- a/source/gfx/blur/gfx-blur-box-linear.cpp +++ b/source/gfx/blur/gfx-blur-box-linear.cpp @@ -17,11 +17,14 @@ #include "gfx-blur-box-linear.hpp" #include "common.hpp" +#include "obs/gs/gs-helper.hpp" +#include "plugin.hpp" + +#include "warning-disable.hpp" #include #include #include -#include "obs/gs/gs-helper.hpp" -#include "plugin.hpp" +#include "warning-enable.hpp" #define ST_MAX_BLUR_SIZE 128 // Also change this in box-linear.effect if modified. diff --git a/source/gfx/blur/gfx-blur-box-linear.hpp b/source/gfx/blur/gfx-blur-box-linear.hpp index 5f6df0f0..031604ed 100644 --- a/source/gfx/blur/gfx-blur-box-linear.hpp +++ b/source/gfx/blur/gfx-blur-box-linear.hpp @@ -17,12 +17,15 @@ #pragma once #include "common.hpp" -#include #include "gfx-blur-base.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace blur { class box_linear_data { diff --git a/source/gfx/blur/gfx-blur-box.cpp b/source/gfx/blur/gfx-blur-box.cpp index 338be7eb..369c68c4 100644 --- a/source/gfx/blur/gfx-blur-box.cpp +++ b/source/gfx/blur/gfx-blur-box.cpp @@ -17,11 +17,14 @@ #include "gfx-blur-box.hpp" #include "common.hpp" +#include "obs/gs/gs-helper.hpp" +#include "plugin.hpp" + +#include "warning-disable.hpp" #include #include #include -#include "obs/gs/gs-helper.hpp" -#include "plugin.hpp" +#include "warning-enable.hpp" #define ST_MAX_BLUR_SIZE 128 // Also change this in box.effect if modified. diff --git a/source/gfx/blur/gfx-blur-box.hpp b/source/gfx/blur/gfx-blur-box.hpp index 7316afbc..6e489ace 100644 --- a/source/gfx/blur/gfx-blur-box.hpp +++ b/source/gfx/blur/gfx-blur-box.hpp @@ -17,12 +17,15 @@ #pragma once #include "common.hpp" -#include #include "gfx-blur-base.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace blur { class box_data { diff --git a/source/gfx/blur/gfx-blur-dual-filtering.cpp b/source/gfx/blur/gfx-blur-dual-filtering.cpp index d421904f..40ae3dba 100644 --- a/source/gfx/blur/gfx-blur-dual-filtering.cpp +++ b/source/gfx/blur/gfx-blur-dual-filtering.cpp @@ -17,11 +17,14 @@ #include "gfx-blur-dual-filtering.hpp" #include "common.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + // Dual Filtering Blur // // This type of Blur uses downsampling and upsampling and clever math. That makes it less diff --git a/source/gfx/blur/gfx-blur-dual-filtering.hpp b/source/gfx/blur/gfx-blur-dual-filtering.hpp index d5948686..2afb8942 100644 --- a/source/gfx/blur/gfx-blur-dual-filtering.hpp +++ b/source/gfx/blur/gfx-blur-dual-filtering.hpp @@ -17,13 +17,16 @@ #pragma once #include "common.hpp" -#include -#include #include "gfx-blur-base.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace blur { class dual_filtering_data { diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.cpp b/source/gfx/blur/gfx-blur-gaussian-linear.cpp index e7ba118b..d9a11312 100644 --- a/source/gfx/blur/gfx-blur-gaussian-linear.cpp +++ b/source/gfx/blur/gfx-blur-gaussian-linear.cpp @@ -17,9 +17,12 @@ #include "gfx-blur-gaussian-linear.hpp" #include "common.hpp" -#include #include "obs/gs/gs-helper.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + // FIXME: This breaks when MAX_KERNEL_SIZE is changed, due to the way the Gaussian // function first goes up at the point, and then once we pass the critical point // will go down again and it is not handled well. This is a pretty basic diff --git a/source/gfx/blur/gfx-blur-gaussian-linear.hpp b/source/gfx/blur/gfx-blur-gaussian-linear.hpp index 26efe352..e3f356d0 100644 --- a/source/gfx/blur/gfx-blur-gaussian-linear.hpp +++ b/source/gfx/blur/gfx-blur-gaussian-linear.hpp @@ -17,13 +17,16 @@ #pragma once #include "common.hpp" -#include -#include #include "gfx-blur-base.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace blur { class gaussian_linear_data { diff --git a/source/gfx/blur/gfx-blur-gaussian.cpp b/source/gfx/blur/gfx-blur-gaussian.cpp index ebcc9bf4..6cc447a6 100644 --- a/source/gfx/blur/gfx-blur-gaussian.cpp +++ b/source/gfx/blur/gfx-blur-gaussian.cpp @@ -17,11 +17,14 @@ #include "gfx-blur-gaussian.hpp" #include "common.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + // TODO: It may be possible to optimize to run much faster: https://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ #define ST_KERNEL_SIZE 128u diff --git a/source/gfx/blur/gfx-blur-gaussian.hpp b/source/gfx/blur/gfx-blur-gaussian.hpp index e8d665f0..07ae8477 100644 --- a/source/gfx/blur/gfx-blur-gaussian.hpp +++ b/source/gfx/blur/gfx-blur-gaussian.hpp @@ -17,13 +17,16 @@ #pragma once #include "common.hpp" -#include -#include #include "gfx-blur-base.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace blur { class gaussian_data { diff --git a/source/gfx/gfx-debug.cpp b/source/gfx/gfx-debug.cpp index 77eb8ce8..9c174b25 100644 --- a/source/gfx/gfx-debug.cpp +++ b/source/gfx/gfx-debug.cpp @@ -19,12 +19,15 @@ // SOFTWARE. #include "gfx-debug.hpp" -#include #include "graphics/matrix4.h" #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/gfx/gfx-debug.hpp b/source/gfx/gfx-debug.hpp index d904cb65..0476c05e 100644 --- a/source/gfx/gfx-debug.hpp +++ b/source/gfx/gfx-debug.hpp @@ -18,10 +18,13 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -#include #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-vertexbuffer.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { class debug { std::shared_ptr<::streamfx::obs::gs::effect> _effect; diff --git a/source/gfx/gfx-opengl.cpp b/source/gfx/gfx-opengl.cpp index d34eca16..91f18219 100644 --- a/source/gfx/gfx-opengl.cpp +++ b/source/gfx/gfx-opengl.cpp @@ -19,21 +19,15 @@ // SOFTWARE. #include "gfx-opengl.hpp" -#include #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + // OpenGL -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include "glad/gl.h" #ifdef D_PLATFORM_WINDOWS #include "glad/wgl.h" @@ -41,11 +35,7 @@ #ifdef D_PLATFORM_LINUX #include "glad/glx.h" #endif -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " diff --git a/source/gfx/gfx-opengl.hpp b/source/gfx/gfx-opengl.hpp index 7696d905..8825f467 100644 --- a/source/gfx/gfx-opengl.hpp +++ b/source/gfx/gfx-opengl.hpp @@ -18,7 +18,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" namespace streamfx::gfx { class opengl { diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index dc29091e..9bc1f196 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -16,10 +16,13 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-source-texture.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "obs/obs-tools.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + streamfx::gfx::source_texture::~source_texture() { if (_child && _parent) { diff --git a/source/gfx/gfx-source-texture.hpp b/source/gfx/gfx-source-texture.hpp index e930aff1..5eae0fc2 100644 --- a/source/gfx/gfx-source-texture.hpp +++ b/source/gfx/gfx-source-texture.hpp @@ -17,11 +17,14 @@ #pragma once #include "common.hpp" -#include #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" #include "obs/obs-weak-source.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { class source_texture { streamfx::obs::source _parent; diff --git a/source/gfx/lut/gfx-lut-consumer.cpp b/source/gfx/lut/gfx-lut-consumer.cpp index 54f8d685..bfde55dd 100644 --- a/source/gfx/lut/gfx-lut-consumer.cpp +++ b/source/gfx/lut/gfx-lut-consumer.cpp @@ -19,7 +19,6 @@ // SOFTWARE. #include "gfx-lut-consumer.hpp" - #include "obs/gs/gs-helper.hpp" streamfx::gfx::lut::consumer::consumer() diff --git a/source/gfx/lut/gfx-lut-consumer.hpp b/source/gfx/lut/gfx-lut-consumer.hpp index c407e9b4..10bbd66b 100644 --- a/source/gfx/lut/gfx-lut-consumer.hpp +++ b/source/gfx/lut/gfx-lut-consumer.hpp @@ -19,12 +19,14 @@ // SOFTWARE. #pragma once -#include - #include "gfx-lut.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx::lut { class consumer { std::shared_ptr _data; diff --git a/source/gfx/lut/gfx-lut-producer.hpp b/source/gfx/lut/gfx-lut-producer.hpp index 3478faf2..50b64446 100644 --- a/source/gfx/lut/gfx-lut-producer.hpp +++ b/source/gfx/lut/gfx-lut-producer.hpp @@ -19,11 +19,12 @@ // SOFTWARE. #pragma once +#include "warning-disable.hpp" #include - #include "gfx-lut.hpp" #include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-rendertarget.hpp" +#include "warning-enable.hpp" namespace streamfx::gfx::lut { class producer { diff --git a/source/gfx/lut/gfx-lut.cpp b/source/gfx/lut/gfx-lut.cpp index 1a06720f..fbd6f160 100644 --- a/source/gfx/lut/gfx-lut.cpp +++ b/source/gfx/lut/gfx-lut.cpp @@ -19,11 +19,14 @@ // SOFTWARE. #include "gfx-lut.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/gfx/lut/gfx-lut.hpp b/source/gfx/lut/gfx-lut.hpp index 6296c833..e3631889 100644 --- a/source/gfx/lut/gfx-lut.hpp +++ b/source/gfx/lut/gfx-lut.hpp @@ -19,10 +19,12 @@ // SOFTWARE. #pragma once -#include - #include "obs/gs/gs-effect.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx::lut { class data { std::shared_ptr _producer_effect; diff --git a/source/gfx/shader/gfx-shader-param-basic.cpp b/source/gfx/shader/gfx-shader-param-basic.cpp index 2b0e42af..3f61f4d7 100644 --- a/source/gfx/shader/gfx-shader-param-basic.cpp +++ b/source/gfx/shader/gfx-shader-param-basic.cpp @@ -17,10 +17,13 @@ #include "gfx-shader-param-basic.hpp" #include "strings.hpp" + +#include "warning-disable.hpp" #include #include #include #include +#include "warning-enable.hpp" static const std::string_view _annotation_field_type = "field_type"; static const std::string_view _annotation_suffix = "suffix"; diff --git a/source/gfx/shader/gfx-shader-param-basic.hpp b/source/gfx/shader/gfx-shader-param-basic.hpp index 0a8e0ee6..5d3bb263 100644 --- a/source/gfx/shader/gfx-shader-param-basic.hpp +++ b/source/gfx/shader/gfx-shader-param-basic.hpp @@ -17,10 +17,13 @@ #pragma once #include "common.hpp" -#include #include "gfx-shader-param.hpp" #include "obs/gs/gs-effect-parameter.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace shader { enum class basic_field_type { diff --git a/source/gfx/shader/gfx-shader-param-texture.cpp b/source/gfx/shader/gfx-shader-param-texture.cpp index d26f12d7..c16f5b8f 100644 --- a/source/gfx/shader/gfx-shader-param-texture.cpp +++ b/source/gfx/shader/gfx-shader-param-texture.cpp @@ -17,15 +17,18 @@ #include "gfx-shader-param-texture.hpp" #include "strings.hpp" -#include -#include -#include #include "gfx-shader.hpp" #include "gfx/gfx-debug.hpp" #include "obs/gs/gs-helper.hpp" #include "obs/obs-source-tracker.hpp" #include "util/util-platform.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + // TODO: // - FFT Audio Conversion // - FFT Variable Size... diff --git a/source/gfx/shader/gfx-shader-param-texture.hpp b/source/gfx/shader/gfx-shader-param-texture.hpp index 8c27f909..564e16a0 100644 --- a/source/gfx/shader/gfx-shader-param-texture.hpp +++ b/source/gfx/shader/gfx-shader-param-texture.hpp @@ -1,8 +1,6 @@ #pragma once #include "common.hpp" -#include -#include #include "gfx-shader-param.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-texture.hpp" @@ -12,6 +10,11 @@ #include "obs/obs-tools.hpp" #include "obs/obs-weak-source.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::gfx { namespace shader { enum class texture_field_type { diff --git a/source/gfx/shader/gfx-shader-param.cpp b/source/gfx/shader/gfx-shader-param.cpp index 620b99e7..a16d2247 100644 --- a/source/gfx/shader/gfx-shader-param.cpp +++ b/source/gfx/shader/gfx-shader-param.cpp @@ -16,11 +16,14 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-shader-param.hpp" -#include -#include #include "gfx-shader-param-basic.hpp" #include "gfx-shader-param-texture.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #define ST_ANNO_ORDER "order" #define ST_ANNO_VISIBILITY "visible" #define ST_ANNO_AUTOMATIC "automatic" diff --git a/source/gfx/shader/gfx-shader-param.hpp b/source/gfx/shader/gfx-shader-param.hpp index 5561aefc..3567d2eb 100644 --- a/source/gfx/shader/gfx-shader-param.hpp +++ b/source/gfx/shader/gfx-shader-param.hpp @@ -16,9 +16,12 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #pragma once +#include "obs/gs/gs-effect-parameter.hpp" + +#include "warning-disable.hpp" #include #include -#include "obs/gs/gs-effect-parameter.hpp" +#include "warning-enable.hpp" namespace streamfx::gfx { namespace shader { diff --git a/source/gfx/shader/gfx-shader.cpp b/source/gfx/shader/gfx-shader.cpp index e3d26693..a40d5719 100644 --- a/source/gfx/shader/gfx-shader.cpp +++ b/source/gfx/shader/gfx-shader.cpp @@ -16,13 +16,16 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA #include "gfx-shader.hpp" -#include -#include -#include #include "obs/gs/gs-helper.hpp" #include "obs/obs-tools.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #define ST_I18N "Shader" #define ST_I18N_REFRESH ST_I18N ".Refresh" #define ST_KEY_REFRESH "Shader.Refresh" diff --git a/source/gfx/shader/gfx-shader.hpp b/source/gfx/shader/gfx-shader.hpp index b90d1e62..06a2c33c 100644 --- a/source/gfx/shader/gfx-shader.hpp +++ b/source/gfx/shader/gfx-shader.hpp @@ -17,13 +17,16 @@ #pragma once #include "common.hpp" +#include "gfx/shader/gfx-shader-param.hpp" +#include "obs/gs/gs-effect.hpp" +#include "obs/gs/gs-rendertarget.hpp" + +#include "warning-disable.hpp" #include #include #include #include -#include "gfx/shader/gfx-shader-param.hpp" -#include "obs/gs/gs-effect.hpp" -#include "obs/gs/gs-rendertarget.hpp" +#include "warning-enable.hpp" namespace streamfx::gfx { namespace shader { diff --git a/source/nvidia/ar/nvidia-ar-facedetection.cpp b/source/nvidia/ar/nvidia-ar-facedetection.cpp index a27ca897..2d826ce5 100644 --- a/source/nvidia/ar/nvidia-ar-facedetection.cpp +++ b/source/nvidia/ar/nvidia-ar-facedetection.cpp @@ -18,11 +18,14 @@ */ #include "nvidia-ar-facedetection.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/ar/nvidia-ar-feature.hpp b/source/nvidia/ar/nvidia-ar-feature.hpp index 44cda225..2c46e372 100644 --- a/source/nvidia/ar/nvidia-ar-feature.hpp +++ b/source/nvidia/ar/nvidia-ar-feature.hpp @@ -19,13 +19,16 @@ // SOFTWARE. #pragma once -#include #include "nvidia/ar/nvidia-ar.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "nvidia/cv/nvidia-cv-image.hpp" #include "nvidia/cv/nvidia-cv-texture.hpp" #include "nvidia/cv/nvidia-cv.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::ar { class feature { protected: diff --git a/source/nvidia/ar/nvidia-ar.cpp b/source/nvidia/ar/nvidia-ar.cpp index f178074a..b8966f5e 100644 --- a/source/nvidia/ar/nvidia-ar.cpp +++ b/source/nvidia/ar/nvidia-ar.cpp @@ -19,13 +19,16 @@ // SOFTWARE. #include "nvidia-ar.hpp" -#include -#include #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/util-platform.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -41,24 +44,11 @@ #endif #ifdef WIN32 -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #define ST_LIBRARY_NAME "nvARPose.dll" #else diff --git a/source/nvidia/ar/nvidia-ar.hpp b/source/nvidia/ar/nvidia-ar.hpp index 9ec661a9..05556a6e 100644 --- a/source/nvidia/ar/nvidia-ar.hpp +++ b/source/nvidia/ar/nvidia-ar.hpp @@ -19,9 +19,12 @@ // SOFTWARE. #pragma once -#include #include "nvidia/cv/nvidia-cv.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #define P_NVAR_DEFINE_FUNCTION(name, ...) \ private: \ typedef ::streamfx::nvidia::cv::result (*t##name)(__VA_ARGS__); \ diff --git a/source/nvidia/cuda/nvidia-cuda-context.cpp b/source/nvidia/cuda/nvidia-cuda-context.cpp index a431a337..da933e49 100644 --- a/source/nvidia/cuda/nvidia-cuda-context.cpp +++ b/source/nvidia/cuda/nvidia-cuda-context.cpp @@ -18,9 +18,12 @@ */ #include "nvidia-cuda-context.hpp" +#include "util/util-logging.hpp" + +#include "warning-disable.hpp" #include #include -#include "util/util-logging.hpp" +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " @@ -37,22 +40,9 @@ #endif #ifdef WIN32 -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #endif #define ENABLE_STACK_CHECKS diff --git a/source/nvidia/cuda/nvidia-cuda-context.hpp b/source/nvidia/cuda/nvidia-cuda-context.hpp index e231488f..c2d15c54 100644 --- a/source/nvidia/cuda/nvidia-cuda-context.hpp +++ b/source/nvidia/cuda/nvidia-cuda-context.hpp @@ -18,9 +18,12 @@ */ #pragma once -#include #include "nvidia-cuda.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cuda { class context_stack; diff --git a/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp b/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp index a110a81e..a18b37e5 100644 --- a/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp +++ b/source/nvidia/cuda/nvidia-cuda-gs-texture.hpp @@ -18,12 +18,15 @@ */ #pragma once -#include -#include #include "nvidia-cuda-stream.hpp" #include "nvidia-cuda.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cuda { class gstexture { std::shared_ptr<::streamfx::nvidia::cuda::cuda> _cuda; diff --git a/source/nvidia/cuda/nvidia-cuda-memory.cpp b/source/nvidia/cuda/nvidia-cuda-memory.cpp index 7661c3c0..61b13109 100644 --- a/source/nvidia/cuda/nvidia-cuda-memory.cpp +++ b/source/nvidia/cuda/nvidia-cuda-memory.cpp @@ -18,9 +18,12 @@ */ #include "nvidia-cuda-memory.hpp" -#include #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/cuda/nvidia-cuda-memory.hpp b/source/nvidia/cuda/nvidia-cuda-memory.hpp index 4f80714b..6de825de 100644 --- a/source/nvidia/cuda/nvidia-cuda-memory.hpp +++ b/source/nvidia/cuda/nvidia-cuda-memory.hpp @@ -18,9 +18,12 @@ */ #pragma once +#include "nvidia-cuda.hpp" + +#include "warning-disable.hpp" #include #include -#include "nvidia-cuda.hpp" +#include "warning-enable.hpp" namespace streamfx::nvidia::cuda { class memory { diff --git a/source/nvidia/cuda/nvidia-cuda-obs.hpp b/source/nvidia/cuda/nvidia-cuda-obs.hpp index 555459c5..0239286a 100644 --- a/source/nvidia/cuda/nvidia-cuda-obs.hpp +++ b/source/nvidia/cuda/nvidia-cuda-obs.hpp @@ -18,11 +18,14 @@ */ #pragma once -#include #include "nvidia-cuda-context.hpp" #include "nvidia-cuda-stream.hpp" #include "nvidia-cuda.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cuda { class obs { std::shared_ptr<::streamfx::nvidia::cuda::cuda> _cuda; diff --git a/source/nvidia/cuda/nvidia-cuda-stream.cpp b/source/nvidia/cuda/nvidia-cuda-stream.cpp index fcb7a854..37edb10b 100644 --- a/source/nvidia/cuda/nvidia-cuda-stream.cpp +++ b/source/nvidia/cuda/nvidia-cuda-stream.cpp @@ -18,9 +18,12 @@ */ #include "nvidia-cuda-stream.hpp" -#include #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/cuda/nvidia-cuda-stream.hpp b/source/nvidia/cuda/nvidia-cuda-stream.hpp index 007adb68..1ac35dae 100644 --- a/source/nvidia/cuda/nvidia-cuda-stream.hpp +++ b/source/nvidia/cuda/nvidia-cuda-stream.hpp @@ -18,9 +18,12 @@ */ #pragma once -#include #include "nvidia-cuda.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cuda { class stream { std::shared_ptr<::streamfx::nvidia::cuda::cuda> _cuda; diff --git a/source/nvidia/cuda/nvidia-cuda.cpp b/source/nvidia/cuda/nvidia-cuda.cpp index da2f44b9..9f80b058 100644 --- a/source/nvidia/cuda/nvidia-cuda.cpp +++ b/source/nvidia/cuda/nvidia-cuda.cpp @@ -18,9 +18,12 @@ */ #include "nvidia-cuda.hpp" -#include #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/cuda/nvidia-cuda.hpp b/source/nvidia/cuda/nvidia-cuda.hpp index e6f1a3b8..f43e5fb4 100644 --- a/source/nvidia/cuda/nvidia-cuda.hpp +++ b/source/nvidia/cuda/nvidia-cuda.hpp @@ -18,29 +18,19 @@ */ #pragma once -#include -#include #include "util/util-bitmask.hpp" #include "util/util-library.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef WIN32 -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #endif #define P_CUDA_DEFINE_FUNCTION(name, ...) \ diff --git a/source/nvidia/cv/nvidia-cv-image.hpp b/source/nvidia/cv/nvidia-cv-image.hpp index 0348d0d1..7d166fb8 100644 --- a/source/nvidia/cv/nvidia-cv-image.hpp +++ b/source/nvidia/cv/nvidia-cv-image.hpp @@ -19,9 +19,12 @@ // SOFTWARE. #pragma once -#include #include "nvidia/cv/nvidia-cv.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cv { using ::streamfx::nvidia::cv::component_layout; using ::streamfx::nvidia::cv::component_type; diff --git a/source/nvidia/cv/nvidia-cv-texture.hpp b/source/nvidia/cv/nvidia-cv-texture.hpp index 0852a6f0..7ebab58e 100644 --- a/source/nvidia/cv/nvidia-cv-texture.hpp +++ b/source/nvidia/cv/nvidia-cv-texture.hpp @@ -19,10 +19,13 @@ // SOFTWARE. #pragma once -#include #include "nvidia/cv/nvidia-cv-image.hpp" #include "obs/gs/gs-texture.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::cv { using ::streamfx::nvidia::cv::component_layout; using ::streamfx::nvidia::cv::component_type; diff --git a/source/nvidia/cv/nvidia-cv.cpp b/source/nvidia/cv/nvidia-cv.cpp index d248a9b5..74655cee 100644 --- a/source/nvidia/cv/nvidia-cv.cpp +++ b/source/nvidia/cv/nvidia-cv.cpp @@ -23,13 +23,16 @@ // - NVIDIA Augmented Reality SDK #include "nvidia-cv.hpp" -#include -#include #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/util-platform.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -45,24 +48,11 @@ #endif #if defined(WIN32) -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #define LIB_NAME "NVCVImage.dll" #else diff --git a/source/nvidia/cv/nvidia-cv.hpp b/source/nvidia/cv/nvidia-cv.hpp index 0d7b35d9..e189095a 100644 --- a/source/nvidia/cv/nvidia-cv.hpp +++ b/source/nvidia/cv/nvidia-cv.hpp @@ -19,30 +19,17 @@ // SOFTWARE. #pragma once -#include #include "nvidia/cuda/nvidia-cuda.hpp" #include "util/util-bitmask.hpp" #include "util/util-library.hpp" +#include "warning-disable.hpp" +#include #ifdef WIN32 -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif #endif +#include "warning-enable.hpp" #define NVCVI_DEFINE_FUNCTION(name, ...) \ private: \ diff --git a/source/nvidia/vfx/nvidia-vfx-denoising.cpp b/source/nvidia/vfx/nvidia-vfx-denoising.cpp index b8f8050f..598dfd11 100644 --- a/source/nvidia/vfx/nvidia-vfx-denoising.cpp +++ b/source/nvidia/vfx/nvidia-vfx-denoising.cpp @@ -19,12 +19,15 @@ // SOFTWARE. #include "nvidia-vfx-denoising.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/utility.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/vfx/nvidia-vfx-effect.cpp b/source/nvidia/vfx/nvidia-vfx-effect.cpp index b836ba06..0500a941 100644 --- a/source/nvidia/vfx/nvidia-vfx-effect.cpp +++ b/source/nvidia/vfx/nvidia-vfx-effect.cpp @@ -19,10 +19,13 @@ // SOFTWARE. #include "nvidia-vfx-effect.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/vfx/nvidia-vfx-effect.hpp b/source/nvidia/vfx/nvidia-vfx-effect.hpp index 2a0cbf8c..3b28aa29 100644 --- a/source/nvidia/vfx/nvidia-vfx-effect.hpp +++ b/source/nvidia/vfx/nvidia-vfx-effect.hpp @@ -19,9 +19,6 @@ // SOFTWARE. #pragma once -#include -#include -#include #include "nvidia-vfx.hpp" #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "nvidia/cuda/nvidia-cuda-stream.hpp" @@ -31,6 +28,12 @@ #include "nvidia/cv/nvidia-cv.hpp" #include "nvidia/vfx/nvidia-vfx.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + namespace streamfx::nvidia::vfx { using namespace ::streamfx::nvidia; diff --git a/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp b/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp index e07aa35f..e57008b1 100644 --- a/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp +++ b/source/nvidia/vfx/nvidia-vfx-greenscreen.cpp @@ -19,13 +19,16 @@ // SOFTWARE. #include "nvidia-vfx-greenscreen.hpp" -#include -#include #include "nvidia/cv/nvidia-cv.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/utility.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/vfx/nvidia-vfx-superresolution.cpp b/source/nvidia/vfx/nvidia-vfx-superresolution.cpp index eefc9f30..f96df745 100644 --- a/source/nvidia/vfx/nvidia-vfx-superresolution.cpp +++ b/source/nvidia/vfx/nvidia-vfx-superresolution.cpp @@ -19,13 +19,16 @@ // SOFTWARE. #include "nvidia-vfx-superresolution.hpp" -#include -#include -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/utility.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/nvidia/vfx/nvidia-vfx.cpp b/source/nvidia/vfx/nvidia-vfx.cpp index 0572e3a2..a9a45d2f 100644 --- a/source/nvidia/vfx/nvidia-vfx.cpp +++ b/source/nvidia/vfx/nvidia-vfx.cpp @@ -19,13 +19,16 @@ // SOFTWARE. #include "nvidia-vfx.hpp" -#include -#include #include "nvidia/cuda/nvidia-cuda-obs.hpp" #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" #include "util/util-platform.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) @@ -41,24 +44,11 @@ #endif #if defined(WIN32) -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" #define LIB_NAME "NVVideoEffects.dll" #else diff --git a/source/nvidia/vfx/nvidia-vfx.hpp b/source/nvidia/vfx/nvidia-vfx.hpp index 217eaff1..1013d2e5 100644 --- a/source/nvidia/vfx/nvidia-vfx.hpp +++ b/source/nvidia/vfx/nvidia-vfx.hpp @@ -19,9 +19,12 @@ // SOFTWARE. #pragma once -#include #include "nvidia/cv/nvidia-cv.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #define NVVFX_DEFINE_FUNCTION(name, ...) \ private: \ typedef ::streamfx::nvidia::cv::result(__cdecl* t##name)(__VA_ARGS__); \ diff --git a/source/obs/gs/gs-effect-parameter.cpp b/source/obs/gs/gs-effect-parameter.cpp index 8ac54e5a..0a58c0a0 100644 --- a/source/obs/gs/gs-effect-parameter.cpp +++ b/source/obs/gs/gs-effect-parameter.cpp @@ -18,27 +18,17 @@ */ #include "gs-effect-parameter.hpp" -#include -#include #include "gs-effect-pass.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } streamfx::obs::gs::effect_parameter::effect_parameter() diff --git a/source/obs/gs/gs-effect-pass.cpp b/source/obs/gs/gs-effect-pass.cpp index 5b3856da..ee710f00 100644 --- a/source/obs/gs/gs-effect-pass.cpp +++ b/source/obs/gs/gs-effect-pass.cpp @@ -18,25 +18,15 @@ */ #include "gs-effect-pass.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } streamfx::obs::gs::effect_pass::effect_pass(gs_epass_t* pass, std::shared_ptr parent) : _parent(parent) diff --git a/source/obs/gs/gs-effect-technique.cpp b/source/obs/gs/gs-effect-technique.cpp index e7bb1bb6..767c1b1e 100644 --- a/source/obs/gs/gs-effect-technique.cpp +++ b/source/obs/gs/gs-effect-technique.cpp @@ -18,26 +18,16 @@ */ #include "gs-effect-technique.hpp" + +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } streamfx::obs::gs::effect_technique::effect_technique(gs_technique_t* technique, std::shared_ptr parent) diff --git a/source/obs/gs/gs-effect.cpp b/source/obs/gs/gs-effect.cpp index a89f97bc..28101a93 100644 --- a/source/obs/gs/gs-effect.cpp +++ b/source/obs/gs/gs-effect.cpp @@ -18,12 +18,15 @@ */ #include "gs-effect.hpp" +#include "obs/gs/gs-helper.hpp" +#include "util/util-platform.hpp" + +#include "warning-disable.hpp" #include #include #include #include -#include "obs/gs/gs-helper.hpp" -#include "util/util-platform.hpp" +#include "warning-enable.hpp" #define MAX_EFFECT_SIZE 32 * 1024 * 1024 // 32 MiB, big enough for everything. diff --git a/source/obs/gs/gs-effect.hpp b/source/obs/gs/gs-effect.hpp index 4d065443..4f1fbe25 100644 --- a/source/obs/gs/gs-effect.hpp +++ b/source/obs/gs/gs-effect.hpp @@ -19,11 +19,14 @@ #pragma once #include "common.hpp" -#include -#include #include "gs-effect-parameter.hpp" #include "gs-effect-technique.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + namespace streamfx::obs::gs { class effect : public std::shared_ptr { public: diff --git a/source/obs/gs/gs-helper.hpp b/source/obs/gs/gs-helper.hpp index e8f1315c..ad1b35de 100644 --- a/source/obs/gs/gs-helper.hpp +++ b/source/obs/gs/gs-helper.hpp @@ -19,9 +19,12 @@ #pragma once #include "common.hpp" -#include #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + namespace streamfx::obs::gs { class context { public: diff --git a/source/obs/gs/gs-indexbuffer.cpp b/source/obs/gs/gs-indexbuffer.cpp index 02cd4d3f..f677788a 100644 --- a/source/obs/gs/gs-indexbuffer.cpp +++ b/source/obs/gs/gs-indexbuffer.cpp @@ -18,10 +18,13 @@ */ #include "gs-indexbuffer.hpp" -#include #include "gs-limits.hpp" #include "obs/gs/gs-helper.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + streamfx::obs::gs::index_buffer::index_buffer(uint32_t maximumVertices) { this->reserve(maximumVertices); diff --git a/source/obs/gs/gs-indexbuffer.hpp b/source/obs/gs/gs-indexbuffer.hpp index b160f0bd..b1ff5bab 100644 --- a/source/obs/gs/gs-indexbuffer.hpp +++ b/source/obs/gs/gs-indexbuffer.hpp @@ -19,7 +19,10 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" namespace streamfx::obs::gs { class index_buffer : public std::vector { diff --git a/source/obs/gs/gs-mipmapper.cpp b/source/obs/gs/gs-mipmapper.cpp index b9eada3a..fd4df3cb 100644 --- a/source/obs/gs/gs-mipmapper.cpp +++ b/source/obs/gs/gs-mipmapper.cpp @@ -18,28 +18,22 @@ */ #include "gs-mipmapper.hpp" -#include -#include #include "obs/gs/gs-helper.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include // Direct3D 11 #ifdef _WIN32 -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4191 4242 4244 4365 4777 4986 5039 5204) -#endif #include #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) #endif -#endif - // OpenGL #include "glad/gl.h" +#include "warning-enable.hpp" #ifdef _WIN32 struct d3d_info { diff --git a/source/obs/gs/gs-rendertarget.cpp b/source/obs/gs/gs-rendertarget.cpp index 46e330de..5a3a6d84 100644 --- a/source/obs/gs/gs-rendertarget.cpp +++ b/source/obs/gs/gs-rendertarget.cpp @@ -18,9 +18,12 @@ */ #include "gs-rendertarget.hpp" -#include #include "obs/gs/gs-helper.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + streamfx::obs::gs::rendertarget::~rendertarget() { auto gctx = streamfx::obs::gs::context(); diff --git a/source/obs/gs/gs-sampler.cpp b/source/obs/gs/gs-sampler.cpp index bd6913bb..8a801bad 100644 --- a/source/obs/gs/gs-sampler.cpp +++ b/source/obs/gs/gs-sampler.cpp @@ -18,7 +18,10 @@ */ #include "gs-sampler.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" streamfx::obs::gs::sampler::sampler() { diff --git a/source/obs/gs/gs-texture.cpp b/source/obs/gs/gs-texture.cpp index eb4f17e9..e71e8008 100644 --- a/source/obs/gs/gs-texture.cpp +++ b/source/obs/gs/gs-texture.cpp @@ -18,10 +18,13 @@ */ #include "gs-texture.hpp" +#include "obs/gs/gs-helper.hpp" + +#include "warning-disable.hpp" #include #include #include -#include "obs/gs/gs-helper.hpp" +#include "warning-enable.hpp" static uint32_t decode_flags(streamfx::obs::gs::texture::flags texture_flags) { diff --git a/source/obs/gs/gs-vertex.cpp b/source/obs/gs/gs-vertex.cpp index 1052a4f7..39102cb5 100644 --- a/source/obs/gs/gs-vertex.cpp +++ b/source/obs/gs/gs-vertex.cpp @@ -18,7 +18,10 @@ */ #include "gs-vertex.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" streamfx::obs::gs::vertex::vertex() : position(nullptr), normal(nullptr), tangent(nullptr), color(nullptr), _has_store(true), _store(nullptr) diff --git a/source/obs/gs/gs-vertexbuffer.cpp b/source/obs/gs/gs-vertexbuffer.cpp index 8ba49ad7..6e652a24 100644 --- a/source/obs/gs/gs-vertexbuffer.cpp +++ b/source/obs/gs/gs-vertexbuffer.cpp @@ -18,9 +18,12 @@ */ #include "gs-vertexbuffer.hpp" -#include #include "obs/gs/gs-helper.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + void streamfx::obs::gs::vertex_buffer::initialize(uint32_t capacity, uint8_t layers) { finalize(); diff --git a/source/obs/obs-source-tracker.cpp b/source/obs/obs-source-tracker.cpp index aba02a92..133afc43 100644 --- a/source/obs/obs-source-tracker.cpp +++ b/source/obs/obs-source-tracker.cpp @@ -18,11 +18,14 @@ */ #include "obs-source-tracker.hpp" -#include -#include #include "obs/obs-tools.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/obs/obs-source-tracker.hpp b/source/obs/obs-source-tracker.hpp index a8303a70..13a35dca 100644 --- a/source/obs/obs-source-tracker.hpp +++ b/source/obs/obs-source-tracker.hpp @@ -19,9 +19,12 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include #include +#include "warning-enable.hpp" namespace streamfx::obs { class source_tracker { diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index c1506820..f9e0fd58 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -18,13 +18,16 @@ */ #include "obs-tools.hpp" -#include -#include -#include #include "obs-source.hpp" #include "obs-weak-source.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include "warning-enable.hpp" + struct __sfs_data { std::set<::streamfx::obs::weak_source> sources; }; diff --git a/source/obs/obs-weak-source.hpp b/source/obs/obs-weak-source.hpp index b28020e9..301f2224 100644 --- a/source/obs/obs-weak-source.hpp +++ b/source/obs/obs-weak-source.hpp @@ -18,9 +18,12 @@ #pragma once #include "common.hpp" -#include #include "obs-source.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + // ToDo: // - Is FORCE_INLINE necessary for optimal performance, or can LTO handle this? diff --git a/source/plugin.cpp b/source/plugin.cpp index cdb5d6e3..25dff0c0 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -18,8 +18,6 @@ */ #include "plugin.hpp" -#include -#include #include "configuration.hpp" #include "gfx/gfx-opengl.hpp" #include "obs/gs/gs-helper.hpp" @@ -91,6 +89,11 @@ //static std::shared_ptr _updater; #endif +#include "warning-disable.hpp" +#include +#include +#include "warning-enable.hpp" + static std::shared_ptr _threadpool; static std::shared_ptr _gs_fstri_vb; static std::shared_ptr _streamfx_gfx_opengl; diff --git a/source/sources/source-mirror.hpp b/source/sources/source-mirror.hpp index d0f7da0d..5bea7e61 100644 --- a/source/sources/source-mirror.hpp +++ b/source/sources/source-mirror.hpp @@ -19,11 +19,6 @@ #pragma once #include "common.hpp" -#include -#include -#include -#include -#include #include "gfx/gfx-source-texture.hpp" #include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-sampler.hpp" @@ -33,6 +28,14 @@ #include "obs/obs-source.hpp" #include "obs/obs-tools.hpp" +#include "warning-disable.hpp" +#include +#include +#include +#include +#include +#include "warning-enable.hpp" + namespace streamfx::source::mirror { struct mirror_audio_data { mirror_audio_data(const audio_data*, speaker_layout); diff --git a/source/sources/source-shader.cpp b/source/sources/source-shader.cpp index 1a05c77c..c41d303d 100644 --- a/source/sources/source-shader.cpp +++ b/source/sources/source-shader.cpp @@ -19,10 +19,13 @@ #include "source-shader.hpp" #include "strings.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/transitions/transition-shader.cpp b/source/transitions/transition-shader.cpp index fd914d63..58f68ea4 100644 --- a/source/transitions/transition-shader.cpp +++ b/source/transitions/transition-shader.cpp @@ -19,10 +19,13 @@ #include "transition-shader.hpp" #include "strings.hpp" -#include #include "obs/gs/gs-helper.hpp" #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/ui/ui-about-entry.hpp b/source/ui/ui-about-entry.hpp index 692fe885..88186329 100644 --- a/source/ui/ui-about-entry.hpp +++ b/source/ui/ui-about-entry.hpp @@ -19,24 +19,16 @@ #pragma once #include "ui-common.hpp" -#include #include "ui-about.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + +#include "warning-disable.hpp" #include #include "ui_about-entry.h" - -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" namespace streamfx::ui { class about_entry : public QWidget, public Ui::AboutEntry { diff --git a/source/ui/ui-about.cpp b/source/ui/ui-about.cpp index 076233f2..07fe95d4 100644 --- a/source/ui/ui-about.cpp +++ b/source/ui/ui-about.cpp @@ -19,32 +19,18 @@ #include "ui-about.hpp" #include "ui-common.hpp" -#include -#include -#include -#include -#include #include "plugin.hpp" #include "ui-about-entry.hpp" #include "util/util-logging.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4623) -#pragma warning(disable : 4625) -#pragma warning(disable : 4626) -#pragma warning(disable : 5027) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" +#include +#include +#include +#include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " diff --git a/source/ui/ui-about.hpp b/source/ui/ui-about.hpp index 92b8d3b7..9965902a 100644 --- a/source/ui/ui-about.hpp +++ b/source/ui/ui-about.hpp @@ -21,19 +21,9 @@ #include "common.hpp" #include "ui-common.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include "ui_about.h" -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" namespace streamfx::ui { class about : public QDialog, public Ui::About { diff --git a/source/ui/ui-common.hpp b/source/ui/ui-common.hpp index 1820d6a3..58852851 100644 --- a/source/ui/ui-common.hpp +++ b/source/ui/ui-common.hpp @@ -20,13 +20,7 @@ #pragma once #include "common.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include @@ -40,27 +34,10 @@ #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } diff --git a/source/ui/ui-updater.hpp b/source/ui/ui-updater.hpp index daa14f8d..8c89839e 100644 --- a/source/ui/ui-updater.hpp +++ b/source/ui/ui-updater.hpp @@ -22,13 +22,7 @@ #include "ui-common.hpp" #include "updater.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include @@ -41,11 +35,7 @@ Q_DECLARE_METATYPE(::streamfx::version_stage); -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" namespace streamfx::ui { class updater_dialog : public QDialog, public Ui::Updater { diff --git a/source/ui/ui.cpp b/source/ui/ui.cpp index 62b25bed..c8d21d22 100644 --- a/source/ui/ui.cpp +++ b/source/ui/ui.cpp @@ -20,11 +20,14 @@ #include "ui.hpp" #include "strings.hpp" #include "ui-common.hpp" -#include #include "configuration.hpp" #include "obs/obs-tools.hpp" #include "plugin.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + // Translation Keys constexpr std::string_view _i18n_prefix = "StreamFX::"; constexpr std::string_view _i18n_menu = "UI.Menu"; diff --git a/source/updater.cpp b/source/updater.cpp index 47f3553f..98b5924b 100644 --- a/source/updater.cpp +++ b/source/updater.cpp @@ -20,13 +20,16 @@ #include "updater.hpp" #include "version.hpp" +#include "configuration.hpp" +#include "plugin.hpp" +#include "util/util-logging.hpp" + +#include "warning-disable.hpp" #include #include #include #include -#include "configuration.hpp" -#include "plugin.hpp" -#include "util/util-logging.hpp" +#include "warning-enable.hpp" #ifdef _DEBUG #define ST_PREFIX "<%s> " diff --git a/source/updater.hpp b/source/updater.hpp index c64dabcc..7b8a8fdc 100644 --- a/source/updater.hpp +++ b/source/updater.hpp @@ -19,30 +19,16 @@ // SOFTWARE. #pragma once -#include -#include -#include #include "util/util-curl.hpp" #include "util/util-event.hpp" #include "util/util-threadpool.hpp" -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4623) -#pragma warning(disable : 4625) -#pragma warning(disable : 4626) -#pragma warning(disable : 5027) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" +#include +#include +#include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" namespace streamfx { enum class version_stage : uint8_t { diff --git a/source/util/util-bitmask.hpp b/source/util/util-bitmask.hpp index 05a87cee..546d14d8 100644 --- a/source/util/util-bitmask.hpp +++ b/source/util/util-bitmask.hpp @@ -18,8 +18,10 @@ */ #pragma once +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" template struct enable_bitmask_operators { diff --git a/source/util/util-curl.cpp b/source/util/util-curl.cpp index 75db704d..36f53e97 100644 --- a/source/util/util-curl.cpp +++ b/source/util/util-curl.cpp @@ -19,7 +19,10 @@ // SOFTWARE. #include "util-curl.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" int32_t streamfx::util::curl::debug_helper(CURL* handle, curl_infotype type, char* data, size_t size, streamfx::util::curl* self) diff --git a/source/util/util-curl.hpp b/source/util/util-curl.hpp index c8c93040..e8be4e98 100644 --- a/source/util/util-curl.hpp +++ b/source/util/util-curl.hpp @@ -19,33 +19,19 @@ // SOFTWARE. #pragma once +#include "warning-disable.hpp" #include #include #include #include #include #include +#include "warning-enable.hpp" extern "C" { -#ifndef NOMINMAX -#define NOMINMAX -#endif -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } namespace streamfx::util { diff --git a/source/util/util-event.hpp b/source/util/util-event.hpp index 7e8a5847..2b45b09b 100644 --- a/source/util/util-event.hpp +++ b/source/util/util-event.hpp @@ -19,9 +19,12 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include #include +#include "warning-enable.hpp" namespace streamfx::util { template diff --git a/source/util/util-library.cpp b/source/util/util-library.cpp index 5c266cfb..05df8173 100644 --- a/source/util/util-library.cpp +++ b/source/util/util-library.cpp @@ -19,7 +19,6 @@ // SOFTWARE. #include "util-library.hpp" -#include #include "util-platform.hpp" #if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__) // Windows @@ -28,11 +27,14 @@ #define ST_UNIX #endif +#include "warning-disable.hpp" +#include #if defined(ST_WINDOWS) #include #elif defined(ST_UNIX) #include #endif +#include "warning-enable.hpp" streamfx::util::library::library(std::filesystem::path file) : _library(nullptr) { diff --git a/source/util/util-library.hpp b/source/util/util-library.hpp index 2892ec22..9cb781dd 100644 --- a/source/util/util-library.hpp +++ b/source/util/util-library.hpp @@ -19,9 +19,11 @@ // SOFTWARE. #pragma once +#include "warning-disable.hpp" #include #include #include +#include "warning-enable.hpp" namespace streamfx::util { class library { diff --git a/source/util/util-logging.cpp b/source/util/util-logging.cpp index 01649136..c29bfcbc 100644 --- a/source/util/util-logging.cpp +++ b/source/util/util-logging.cpp @@ -19,7 +19,10 @@ #include "util-logging.hpp" #include "common.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" void streamfx::util::logging::log(level lvl, const char* format, ...) { diff --git a/source/util/util-logging.hpp b/source/util/util-logging.hpp index 9f181894..2df58acb 100644 --- a/source/util/util-logging.hpp +++ b/source/util/util-logging.hpp @@ -18,8 +18,10 @@ */ #pragma once +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" #define P_LOG(...) streamfx::util::logging::log(__VA_ARGS__); #define P_LOG_ERROR(...) P_LOG(streamfx::util::logging::level::LEVEL_ERROR, __VA_ARGS__) diff --git a/source/util/util-platform.cpp b/source/util/util-platform.cpp index 0fe41e94..4d663328 100644 --- a/source/util/util-platform.cpp +++ b/source/util/util-platform.cpp @@ -39,7 +39,9 @@ #endif #ifdef WIN32 +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" std::string streamfx::util::platform::native_to_utf8(std::wstring const& v) { diff --git a/source/util/util-platform.hpp b/source/util/util-platform.hpp index 16b60680..2b39d348 100644 --- a/source/util/util-platform.hpp +++ b/source/util/util-platform.hpp @@ -22,8 +22,10 @@ // OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" namespace streamfx::util::platform { #ifdef WIN32 diff --git a/source/util/util-profiler.cpp b/source/util/util-profiler.cpp index cc1d3ef8..8c030f6e 100644 --- a/source/util/util-profiler.cpp +++ b/source/util/util-profiler.cpp @@ -18,7 +18,10 @@ */ #include "util-profiler.hpp" + +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" streamfx::util::profiler::profiler() {} diff --git a/source/util/util-profiler.hpp b/source/util/util-profiler.hpp index 8eb710a5..623a4d9c 100644 --- a/source/util/util-profiler.hpp +++ b/source/util/util-profiler.hpp @@ -19,9 +19,12 @@ #pragma once #include "common.hpp" + +#include "warning-disable.hpp" #include #include #include +#include "warning-enable.hpp" namespace streamfx::util { class profiler : public std::enable_shared_from_this { diff --git a/source/util/util-threadpool.cpp b/source/util/util-threadpool.cpp index ceb8537f..5e719a42 100644 --- a/source/util/util-threadpool.cpp +++ b/source/util/util-threadpool.cpp @@ -19,9 +19,12 @@ #include "util-threadpool.hpp" #include "common.hpp" -#include #include "util/util-logging.hpp" +#include "warning-disable.hpp" +#include +#include "warning-enable.hpp" + #ifdef _DEBUG #define ST_PREFIX "<%s> " #define D_LOG_ERROR(x, ...) P_LOG_ERROR(ST_PREFIX##x, __FUNCTION_SIG__, __VA_ARGS__) diff --git a/source/util/util-threadpool.hpp b/source/util/util-threadpool.hpp index 6b824f45..a003a170 100644 --- a/source/util/util-threadpool.hpp +++ b/source/util/util-threadpool.hpp @@ -18,6 +18,7 @@ */ #pragma once +#include "warning-disable.hpp" #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include "warning-enable.hpp" namespace streamfx::util { typedef std::shared_ptr threadpool_data_t; diff --git a/source/util/utility.cpp b/source/util/utility.cpp index 868f9910..d800b05d 100644 --- a/source/util/utility.cpp +++ b/source/util/utility.cpp @@ -19,10 +19,13 @@ #include "utility.hpp" #include "common.hpp" +#include "plugin.hpp" + +#include "warning-disable.hpp" #include #include #include -#include "plugin.hpp" +#include "warning-enable.hpp" obs_property_t* streamfx::util::obs_properties_add_tristate(obs_properties_t* props, const char* name, const char* desc) { diff --git a/source/util/utility.hpp b/source/util/utility.hpp index 5a481598..7165199a 100644 --- a/source/util/utility.hpp +++ b/source/util/utility.hpp @@ -18,32 +18,21 @@ */ #pragma once +#include "warning-disable.hpp" #include #include #include #include #include +#include "warning-enable.hpp" extern "C" { -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4464) -#pragma warning(disable : 4820) -#pragma warning(disable : 5220) -#else -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wall" -#pragma GCC diagnostic ignored "-Wextra" -#endif +#include "warning-disable.hpp" #include #include #include #include -#ifdef _MSC_VER -#pragma warning(pop) -#else -#pragma GCC diagnostic pop -#endif +#include "warning-enable.hpp" } // Constants diff --git a/source/warning-disable.hpp b/source/warning-disable.hpp new file mode 100644 index 00000000..f06bbf7e --- /dev/null +++ b/source/warning-disable.hpp @@ -0,0 +1,12 @@ +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wall" +#pragma clang diagnostic ignored "-Wextra" +#elif defined(__GNUC__) || defined(__GNUG__) +#pragma gcc diagnostic push +#pragma gcc diagnostic ignored "-Wall" +#pragma gcc diagnostic ignored "-Wextra" +#elif defined(_MSC_VER) +#pragma warning(push, 0) +#else +#endif diff --git a/source/warning-enable.hpp b/source/warning-enable.hpp new file mode 100644 index 00000000..6afcf286 --- /dev/null +++ b/source/warning-enable.hpp @@ -0,0 +1,8 @@ +#if defined(__clang__) +#pragma clang diagnostic pop +#elif defined(__GNUC__) || defined(__GNUG__) +#pragma gcc diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#else +#endif diff --git a/source/windll.cpp b/source/windll.cpp index 30b9cd6e..d2591fa7 100644 --- a/source/windll.cpp +++ b/source/windll.cpp @@ -17,7 +17,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "warning-disable.hpp" #include +#include "warning-enable.hpp" BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID) { diff --git a/templates/module.cpp.in b/templates/module.cpp.in index a81a1298..9f690998 100644 --- a/templates/module.cpp.in +++ b/templates/module.cpp.in @@ -1,3 +1,5 @@ +#include "warning-disable.hpp" + #include "common.hpp" OBS_DECLARE_MODULE() @@ -14,3 +16,4 @@ MODULE_EXPORT const char* obs_module_description() return "@PROJECT_DESCRIPTION@"; } +#include "warning-enable.hpp" diff --git a/templates/version.hpp.in b/templates/version.hpp.in index baf8a53e..5d24ea9d 100644 --- a/templates/version.hpp.in +++ b/templates/version.hpp.in @@ -19,8 +19,10 @@ // SOFTWARE. #pragma once +#include "warning-disable.hpp" #include #include +#include "warning-enable.hpp" #define STREAMFX_MAKE_VERSION(major, minor, patch, tweak) \ (((uint64_t(major) & 0xFFFFull) << 48ull) | ((uint64_t(minor) & 0xFFFFull) << 32ull) \