summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2022-03-27 12:04:05 +0000
committertnn <tnn@pkgsrc.org>2022-03-27 12:04:05 +0000
commit371f915da4495c6a078f12aaecc62c976b38b439 (patch)
treed0e63a0abe2b30a767811e96a5bafbbfe70f3e9e
parentb798a2221e54a40258fe24d18d656bfd3ba63cea (diff)
downloadpkgsrc-371f915da4495c6a078f12aaecc62c976b38b439.tar.gz
google-benchmark: fix build on SunOS
-rw-r--r--benchmarks/google-benchmark/distinfo3
-rw-r--r--benchmarks/google-benchmark/patches/patch-test_benchmark__setup__teardown__test.cc44
2 files changed, 46 insertions, 1 deletions
diff --git a/benchmarks/google-benchmark/distinfo b/benchmarks/google-benchmark/distinfo
index b635b6cb5b6..339b50e9a7f 100644
--- a/benchmarks/google-benchmark/distinfo
+++ b/benchmarks/google-benchmark/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.16 2022/01/16 23:09:35 wiz Exp $
+$NetBSD: distinfo,v 1.17 2022/03/27 12:04:05 tnn Exp $
BLAKE2s (benchmark-1.6.1.tar.gz) = e1d824a20befda52931de3256cbf065724b076fdf4d6feb8b101e56d283f8418
SHA512 (benchmark-1.6.1.tar.gz) = 7d3e3baf5a2d92e9552ab5007c37253b3510ac269edf8922a2794ff3dfbd0bf5b4c519240d4577b1ec30ef9e8a64caa17a809054c3dc7f2b1bcd410596177d67
Size (benchmark-1.6.1.tar.gz) = 184616 bytes
+SHA1 (patch-test_benchmark__setup__teardown__test.cc) = d3baa390eb590628fd42c85ce6ec42767e66c15b
diff --git a/benchmarks/google-benchmark/patches/patch-test_benchmark__setup__teardown__test.cc b/benchmarks/google-benchmark/patches/patch-test_benchmark__setup__teardown__test.cc
new file mode 100644
index 00000000000..b8df1c86eee
--- /dev/null
+++ b/benchmarks/google-benchmark/patches/patch-test_benchmark__setup__teardown__test.cc
@@ -0,0 +1,44 @@
+$NetBSD: patch-test_benchmark__setup__teardown__test.cc,v 1.1 2022/03/27 12:04:05 tnn Exp $
+
+Rename namespace single due to conflict:
+error: 'namespace single { }' redeclared as different kind of entity
+/usr/include/floatingpoint.h:69:15: note: previous declaration 'typedef float single'
+ 69 | typedef float single;
+
+--- test/benchmark_setup_teardown_test.cc.orig 2022-01-10 19:14:27.000000000 +0000
++++ test/benchmark_setup_teardown_test.cc
+@@ -10,19 +10,19 @@
+
+ // Test that Setup() and Teardown() are called exactly once
+ // for each benchmark run (single-threaded).
+-namespace single {
++namespace single_ {
+ static int setup_call = 0;
+ static int teardown_call = 0;
+-} // namespace single
++} // namespace single_
+ static void DoSetup1(const benchmark::State& state) {
+- ++single::setup_call;
++ ++single_::setup_call;
+
+ // Setup/Teardown should never be called with any thread_idx != 0.
+ assert(state.thread_index() == 0);
+ }
+
+ static void DoTeardown1(const benchmark::State& state) {
+- ++single::teardown_call;
++ ++single_::teardown_call;
+ assert(state.thread_index() == 0);
+ }
+
+@@ -134,8 +134,8 @@ int main(int argc, char** argv) {
+ assert(ret > 0);
+
+ // Setup/Teardown is called once for each arg group (1,3,5,7).
+- assert(single::setup_call == 4);
+- assert(single::teardown_call == 4);
++ assert(single_::setup_call == 4);
++ assert(single_::teardown_call == 4);
+
+ // 3 group of threads calling this function (3,5,10).
+ assert(concurrent::setup_call.load(std::memory_order_relaxed) == 3);