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