xref: /xnu-8796.101.5/tests/intrusive_shared_ptr_src/abi_helper.h (revision aca3beaa3dfbd42498b42c5e5ce20a938e6554e5)
1 #ifndef TESTS_INTRUSIVE_SHARED_PTR_ABI_HELPER_H
2 #define TESTS_INTRUSIVE_SHARED_PTR_ABI_HELPER_H
3 
4 #include <libkern/c++/intrusive_shared_ptr.h>
5 #include <darwintest.h>
6 #include "test_policy.h"
7 
8 struct T { int i; };
9 
10 #if defined USE_SHARED_PTR
11 template <typename T>
12 using SharedPtr = libkern::intrusive_shared_ptr<T, test_policy>;
13 #else
14 template <typename T>
15 using SharedPtr = T *;
16 #endif
17 
18 extern SharedPtr<T> return_shared_as_raw(T*);
19 extern SharedPtr<T> return_raw_as_shared(T*);
20 
21 #endif // !TESTS_INTRUSIVE_SHARED_PTR_ABI_HELPER_H
22