Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8336f62

Browse files
committedJan 11, 2024
Fix failing tests on Linux
GCC does not accept an extern "C" storage class specifier along with definition of the global variable. Split declaration and definition to overcome this.
1 parent 2b822f8 commit 8336f62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎tests/ffi/tests.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
extern "C" void cxx_test_suite_set_correct() noexcept;
1414
extern "C" tests::R *cxx_test_suite_get_box() noexcept;
1515
extern "C" bool cxx_test_suite_r_is_correct(const tests::R *) noexcept;
16+
extern "C" bool PmrDeleterForC_callback_used;
17+
18+
bool PmrDeleterForC_callback_used{false};
1619

1720
namespace tests {
1821

@@ -139,8 +142,6 @@ std::unique_ptr<C> c_return_unique_ptr() {
139142
return std::unique_ptr<C>(new C{2020});
140143
}
141144

142-
extern "C" bool PmrDeleterForC_callback_used{false};
143-
144145
void PmrDeleterForC::operator()(C* obj) {
145146
alloc.destroy(obj);
146147
alloc.deallocate(obj, 1);

0 commit comments

Comments
 (0)
Please sign in to comment.