diff --git a/UnitTests/UnitTests.xcodeproj/project.pbxproj b/UnitTests/UnitTests.xcodeproj/project.pbxproj index 04bcc0625..aac53946e 100644 --- a/UnitTests/UnitTests.xcodeproj/project.pbxproj +++ b/UnitTests/UnitTests.xcodeproj/project.pbxproj @@ -318,6 +318,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../include; @@ -375,6 +376,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../include; diff --git a/UnitTests/unicode.cpp b/UnitTests/unicode.cpp index f37e29b90..4fb7a8943 100644 --- a/UnitTests/unicode.cpp +++ b/UnitTests/unicode.cpp @@ -9,7 +9,7 @@ using namespace std; #ifdef _WIN32 using namespace Microsoft::VisualStudio::CppUnitTestFramework; #endif -#ifdef __GNUC__ +#if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif @@ -99,6 +99,6 @@ namespace UnitTests } } -#ifdef __GNUC__ +#if defined(__GNUC__) #pragma GCC diagnostic pop #endif diff --git a/include/stdex/base64.hpp b/include/stdex/base64.hpp index ad6afadbb..98717c75a 100644 --- a/include/stdex/base64.hpp +++ b/include/stdex/base64.hpp @@ -11,6 +11,11 @@ #include #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#endif + namespace stdex { /// \cond internal @@ -363,10 +368,8 @@ namespace stdex size_t m_num; ///< Number of bytes used in `m_buf` }; -#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 26495) -#endif /// /// Converts from Base64 when reading from a stream @@ -451,7 +454,9 @@ namespace stdex m_temp_len; ///< Number of bytes of data in `m_temp` }; -#ifdef _MSC_VER #pragma warning(pop) -#endif } + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif diff --git a/include/stdex/hash.hpp b/include/stdex/hash.hpp index 33aabcda0..30583e902 100644 --- a/include/stdex/hash.hpp +++ b/include/stdex/hash.hpp @@ -10,12 +10,15 @@ #include "stream.hpp" #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#endif + namespace stdex { -#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 26495) -#endif /// /// Basic hashing operations @@ -93,14 +96,10 @@ namespace stdex memcpy(m_queue + j, data, remainder); hash_block(); for (i = remainder; i + 64 <= length; i += 64) { -#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 6385) -#endif memcpy(m_queue, reinterpret_cast(data) + i, 64); -#ifdef _MSC_VER #pragma warning(pop) -#endif hash_block(); } @@ -126,9 +125,7 @@ namespace stdex }; }; -#ifdef _MSC_VER #pragma warning(pop) -#endif /// /// Hashes read to or write from data of the stream @@ -644,3 +641,7 @@ namespace stdex } }; } + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif diff --git a/include/stdex/parser.hpp b/include/stdex/parser.hpp index e9d1eed08..0d81da53d 100644 --- a/include/stdex/parser.hpp +++ b/include/stdex/parser.hpp @@ -31,9 +31,12 @@ #include #include -#ifdef _MSC_VER +#if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable: 4100) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" #endif #define ENUM_FLAG_OPERATOR(T,X) \ @@ -8386,6 +8389,8 @@ namespace stdex #undef ENUM_FLAG_OPERATOR #undef ENUM_FLAGS -#ifdef _MSC_VER +#if defined(_MSC_VER) #pragma warning(pop) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop #endif diff --git a/include/stdex/ring.hpp b/include/stdex/ring.hpp index 87746e270..1ace83a36 100644 --- a/include/stdex/ring.hpp +++ b/include/stdex/ring.hpp @@ -10,6 +10,11 @@ #include #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#endif + namespace stdex { /// @@ -147,3 +152,7 @@ namespace stdex T m_data[N_cap]; }; } + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif diff --git a/include/stdex/stream.hpp b/include/stdex/stream.hpp index 29734df49..fb45ea1d2 100644 --- a/include/stdex/stream.hpp +++ b/include/stdex/stream.hpp @@ -34,6 +34,11 @@ #include #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#endif + #if !defined(SET_FILE_OP_TIMES) && defined(RDAT_BELEZI_CAS_DOSTOPA_VER) #define SET_FILE_OP_TIMES 1 #pragma message("RDAT_BELEZI_CAS_DOSTOPA_VER is deprecated. Use SET_FILE_OP_TIMES instead.") @@ -4312,3 +4317,7 @@ namespace stdex }; } } + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif diff --git a/include/stdex/unicode.hpp b/include/stdex/unicode.hpp index c92f836cf..52354c323 100644 --- a/include/stdex/unicode.hpp +++ b/include/stdex/unicode.hpp @@ -18,7 +18,7 @@ #include #include -#ifdef __GNUC__ +#if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif @@ -976,6 +976,6 @@ namespace stdex #endif } -#ifdef __GNUC__ +#if defined(__GNUC__) #pragma GCC diagnostic pop #endif diff --git a/include/stdex/zlib.hpp b/include/stdex/zlib.hpp index 6d0f05e05..1521fc4d2 100644 --- a/include/stdex/zlib.hpp +++ b/include/stdex/zlib.hpp @@ -19,6 +19,11 @@ #include #include +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#endif + namespace stdex { /// \cond internal @@ -167,3 +172,7 @@ namespace stdex std::unique_ptr m_block; }; } + +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif