Skip to content

Commit

Permalink
Removed LITECORE_UNUSED, FLEECE_UNUSED
Browse files Browse the repository at this point in the history
Replaced with standard [[maybe_unused]]
  • Loading branch information
snej committed Aug 5, 2024
1 parent 2ea3221 commit 433782e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
5 changes: 0 additions & 5 deletions API/fleece/PlatformCompat.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#define NOINLINE __declspec(noinline)
#define ALWAYS_INLINE inline
#define ASSUME(cond) __assume(cond)
#define LITECORE_UNUSED
#define __typeof decltype

#define __func__ __FUNCTION__
Expand All @@ -40,10 +39,6 @@

#else

// Suppresses "unused function" and "unused variable" warnings.
// This macro is deprecated -- use `[[maybe_unused]]` directly.
#define LITECORE_UNUSED [[maybe_unused]]

// Disables inlining a function. Use when the space savings are worth more than speed.
#if __has_attribute(noinline)
# define NOINLINE __attribute((noinline))
Expand Down
11 changes: 2 additions & 9 deletions Tests/PerfTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
#define REQUIRE(TEST) while (!(TEST)) {abort();}
#undef CHECK
#define CHECK(TEST) while (!(TEST)) {abort();}
#ifdef __APPLE__
#define FLEECE_UNUSED __unused
#elif !defined(_MSC_VER)
#define FLEECE_UNUSED __attribute__((unused))
#else
#define FLEECE_UNUSED
#endif


using namespace fleece;
Expand Down Expand Up @@ -116,7 +109,7 @@ TEST_CASE("Perf LoadFleece", "[.Perf]") {
Benchmark bench;
for (int i = 0; i < kIterations; i++) {
bench.start();
FLEECE_UNUSED auto root = Value::fromData(doc)->asArray();
[[maybe_unused]] auto root = Value::fromData(doc)->asArray();
REQUIRE(root != nullptr);
bench.stop();
}
Expand All @@ -130,7 +123,7 @@ TEST_CASE("Perf LoadFleece", "[.Perf]") {
for (int i = 0; i < kIterations; i++) {
bench.start();
for (int j = 0; j < kIterationsPerSample; j++) {
FLEECE_UNUSED auto root = Value::fromTrustedData(doc)->asArray();
[[maybe_unused]] auto root = Value::fromTrustedData(doc)->asArray();
REQUIRE(root != nullptr);
}
bench.stop();
Expand Down

0 comments on commit 433782e

Please sign in to comment.