Skip to content

Commit

Permalink
Fix failing tests on Linux
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
darkwisebear committed Jan 11, 2024
1 parent 2b822f8 commit ed5d2e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/ffi/tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -139,8 +141,6 @@ std::unique_ptr<C> c_return_unique_ptr() {
return std::unique_ptr<C>(new C{2020});
}

extern "C" bool PmrDeleterForC_callback_used{false};

void PmrDeleterForC::operator()(C* obj) {
alloc.destroy(obj);
alloc.deallocate(obj, 1);
Expand Down

0 comments on commit ed5d2e5

Please sign in to comment.