From ab9fcd0255f9ba64de4e486d5857a65e0165b58c Mon Sep 17 00:00:00 2001 From: Vahan Aghajanyan Date: Tue, 28 Mar 2023 12:31:29 +0200 Subject: [PATCH] Fix compiler warnings (Linux) We suppress some 3rd-party code warnings, but it was done using Windows compiler syntax. We fix it to do the same for gcc compiler too. --- src/image.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/image.cpp b/src/image.cpp index 2c23b7e..16bcc94 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -27,13 +27,24 @@ #include "image.h" #include "point.h" -#pragma warning(push, 0) +#if defined(_MSC_VER) + #pragma warning(push, 0) +#else + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" -#pragma warning (pop) + +#if defined(_MSC_VER) + #pragma warning (pop) +#else + #pragma GCC diagnostic pop +#endif namespace nkar {