Add minimal shared_ptr support

Enable the tests and support of shared_ptr in them for C (which required
disabling a previously passing, because not doing anything, attributes
test which is currently broken for unrelated reasons).
This commit is contained in:
Vadim Zeitlin 2021-10-15 01:26:22 +02:00
commit e78c8f39ed
12 changed files with 132 additions and 12 deletions

View file

@ -0,0 +1,16 @@
#include "cpp11_shared_ptr_const_wrap.h"
#include <assert.h>
int main(int argc, const char *argv[]) {
Foo* f;
Foo* f2;
f = Foo_new(17);
assert(Foo_get_m(f) == 17);
f2 = cpp11_shared_ptr_const_foo(f);
assert(Foo_get_m(f2) == 17);
Foo_delete(f2);
Foo_delete(f);
return 0;
}