]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix a name conflict when compiled with zlib-compat
authorAdam Stylinski <kungfujesus06@gmail.com>
Sat, 18 May 2024 22:36:33 +0000 (18:36 -0400)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 19 May 2024 21:19:04 +0000 (23:19 +0200)
The benchmarks fail to compile properly when built with ZLIB_COMPAT.
The name of the class cannot have the same name as the function.

test/benchmarks/benchmark_compress.cc

index f5eb6198298ccd55364a876163730abe3f5971d8..3d63a4417c50acb828bb15e83a237e86a9e92c33 100644 (file)
@@ -19,7 +19,7 @@ extern "C" {
 
 #define MAX_SIZE (32 * 1024)
 
-class compress: public benchmark::Fixture {
+class compress_bench: public benchmark::Fixture {
 private:
     size_t maxlen;
     uint8_t *inbuff;
@@ -59,9 +59,9 @@ public:
 };
 
 #define BENCHMARK_COMPRESS(name) \
-    BENCHMARK_DEFINE_F(compress, name)(benchmark::State& state) { \
+    BENCHMARK_DEFINE_F(compress_bench, name)(benchmark::State& state) { \
         Bench(state); \
     } \
-    BENCHMARK_REGISTER_F(compress, name)->Arg(1)->Arg(8)->Arg(16)->Arg(32)->Arg(64)->Arg(512)->Arg(4<<10)->Arg(32<<10);
+    BENCHMARK_REGISTER_F(compress_bench, name)->Arg(1)->Arg(8)->Arg(16)->Arg(32)->Arg(64)->Arg(512)->Arg(4<<10)->Arg(32<<10);
 
-BENCHMARK_COMPRESS(compress);
+BENCHMARK_COMPRESS(compress_bench);