From f3770b1729a921951502900fe0c833e90e33ea4a Mon Sep 17 00:00:00 2001 From: Pol M Date: Sun, 21 Jul 2024 10:40:16 +0200 Subject: [PATCH] Changes to make this compliant with standard by using the correct header And remove maybe_unused as that is a C++17 extension and could potentially not work in its job of silencing an "unused" warning. --- include/bitsery/adapter/buffer.h | 3 ++- include/bitsery/bitsery.h | 6 ------ include/bitsery/ext/growable.h | 2 +- include/bitsery/ext/std_bitset.h | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/include/bitsery/adapter/buffer.h b/include/bitsery/adapter/buffer.h index 47a8678..1e05b23 100644 --- a/include/bitsery/adapter/buffer.h +++ b/include/bitsery/adapter/buffer.h @@ -276,8 +276,9 @@ class OutputBufferAdapter } } - void maybeResize(BITSERY_MAYBE_UNUSED size_t newOffset, std::false_type) + void maybeResize(size_t newOffset, std::false_type) { + static_cast(newOffset); assert(newOffset <= _bufferSize); } diff --git a/include/bitsery/bitsery.h b/include/bitsery/bitsery.h index 378b3ea..b5dee9d 100644 --- a/include/bitsery/bitsery.h +++ b/include/bitsery/bitsery.h @@ -77,12 +77,6 @@ #define BITSERY_UNLIKELY #endif -#if __has_cpp_attribute(maybe_unused) -#define BITSERY_MAYBE_UNUSED BITSERY_ATTRIBUTE(maybe_unused) -#else -#define BITSERY_MAYBE_UNUSED -#endif - #if __GNUC__ #define BITSERY_NOINLINE __attribute__((noinline)) #elif defined(_MSC_VER) diff --git a/include/bitsery/ext/growable.h b/include/bitsery/ext/growable.h index f6458c2..6ad948c 100644 --- a/include/bitsery/ext/growable.h +++ b/include/bitsery/ext/growable.h @@ -24,7 +24,7 @@ #define BITSERY_EXT_GROWABLE_H #include "../traits/core/traits.h" -#include +#include namespace bitsery { diff --git a/include/bitsery/ext/std_bitset.h b/include/bitsery/ext/std_bitset.h index f34a883..f709147 100644 --- a/include/bitsery/ext/std_bitset.h +++ b/include/bitsery/ext/std_bitset.h @@ -25,7 +25,7 @@ #include "../traits/core/traits.h" #include -#include +#include namespace bitsery { namespace ext {