From ed5d2e5b34e86ddc3666a6eb72b4ea5b33b6e58d Mon Sep 17 00:00:00 2001 From: Markus Hosch Date: Thu, 11 Jan 2024 23:33:30 +0100 Subject: [PATCH] Fix failing tests on Linux GCC does not accept an extern "C" storage class specifier along with definition of the global variable. Remove the specifier and move to the global namespace to fix this. --- tests/ffi/tests.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ffi/tests.cc b/tests/ffi/tests.cc index dffc40540..893bc1051 100644 --- a/tests/ffi/tests.cc +++ b/tests/ffi/tests.cc @@ -14,6 +14,8 @@ extern "C" void cxx_test_suite_set_correct() noexcept; extern "C" tests::R *cxx_test_suite_get_box() noexcept; extern "C" bool cxx_test_suite_r_is_correct(const tests::R *) noexcept; +bool PmrDeleterForC_callback_used{false}; + namespace tests { #if __cplusplus < 201703L @@ -139,8 +141,6 @@ std::unique_ptr c_return_unique_ptr() { return std::unique_ptr(new C{2020}); } -extern "C" bool PmrDeleterForC_callback_used{false}; - void PmrDeleterForC::operator()(C* obj) { alloc.destroy(obj); alloc.deallocate(obj, 1);