]> git.saurik.com Git - apple/xnu.git/blob - tests/intrusive_shared_ptr_src/abi_helper.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / tests / intrusive_shared_ptr_src / abi_helper.h
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