Skip to content

Commit

Permalink
Changes to make this compliant with standard by using the correct header
Browse files Browse the repository at this point in the history
And remove maybe_unused as that is a C++17 extension and could
potentially not work in its job of silencing an "unused" warning.
  • Loading branch information
Destroyerrrocket committed Jul 21, 2024
1 parent 4dcdd59 commit f3770b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion include/bitsery/adapter/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>(newOffset);
assert(newOffset <= _bufferSize);
}

Expand Down
6 changes: 0 additions & 6 deletions include/bitsery/bitsery.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion include/bitsery/ext/growable.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define BITSERY_EXT_GROWABLE_H

#include "../traits/core/traits.h"
#include <cstdint>
#include <stdint.h>

namespace bitsery {

Expand Down
2 changes: 1 addition & 1 deletion include/bitsery/ext/std_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "../traits/core/traits.h"
#include <bitset>
#include <cstdint>
#include <stdint.h>

namespace bitsery {
namespace ext {
Expand Down

0 comments on commit f3770b1

Please sign in to comment.