From 82276ef5ace76681d04cf3e5b82308d8b378d0d8 Mon Sep 17 00:00:00 2001 From: iphydf Date: Sat, 14 Oct 2023 18:03:25 +0000 Subject: [PATCH] cleanup: Fix GCC compatibility. --- .cirrus.yml | 8 +++----- testing/fuzzing/fuzz_support.cc | 8 +++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index f0b49c01..3050eada 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,10 +9,9 @@ bazel-opt_task: - /src/workspace/tools/inject-repo c-toxcore test_all_script: - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST + --config=ci --build_tag_filters=-haskell --test_tag_filters=-haskell - --remote_download_minimal -- //c-toxcore/... -//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus? @@ -27,10 +26,9 @@ bazel-dbg_task: - /src/workspace/tools/inject-repo c-toxcore test_all_script: - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST + --config=ci --build_tag_filters=-haskell --test_tag_filters=-haskell - --remote_download_minimal -- //c-toxcore/... -//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus? @@ -45,7 +43,7 @@ cimple_task: - /src/workspace/tools/inject-repo c-toxcore test_all_script: - cd /src/workspace && bazel test -k - --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST + --config=ci --build_tag_filters=haskell --test_tag_filters=haskell -- diff --git a/testing/fuzzing/fuzz_support.cc b/testing/fuzzing/fuzz_support.cc index 510a6563..04a0bf74 100644 --- a/testing/fuzzing/fuzz_support.cc +++ b/testing/fuzzing/fuzz_support.cc @@ -22,6 +22,8 @@ const bool DEBUG = false; +static constexpr tox_mono_time_cb *get_self_clock = ![](Fuzz_System *self) { return self->clock; }; + // TODO(iphydf): Put this somewhere shared. struct Network_Addr { struct sockaddr_storage addr; @@ -182,7 +184,7 @@ Fuzz_System::Fuzz_System(Fuzz_Data &input) } , data(input) { - sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; }; + sys->mono_time_callback = get_self_clock; sys->mono_time_user_data = this; sys->mem = mem.get(); sys->ns = ns.get(); @@ -269,7 +271,7 @@ Null_System::Null_System() std::make_unique(Random{&null_random_funcs, this}), } { - sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; }; + sys->mono_time_callback = get_self_clock; sys->mono_time_user_data = this; sys->mem = mem.get(); sys->ns = ns.get(); @@ -400,7 +402,7 @@ Record_System::Record_System(Global &global, uint64_t seed, const char *name) , seed_(seed) , name_(name) { - sys->mono_time_callback = ![](Fuzz_System *self) { return self->clock; }; + sys->mono_time_callback = get_self_clock; sys->mono_time_user_data = this; sys->mem = mem.get(); sys->ns = ns.get();