Skip to content

Commit ed5d2e5

Browse files
committed
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.
1 parent 2b822f8 commit ed5d2e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/ffi/tests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ 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;
1616

17+
bool PmrDeleterForC_callback_used{false};
18+
1719
namespace tests {
1820

1921
#if __cplusplus < 201703L
@@ -139,8 +141,6 @@ std::unique_ptr<C> c_return_unique_ptr() {
139141
return std::unique_ptr<C>(new C{2020});
140142
}
141143

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

0 commit comments

Comments
 (0)