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