cbindgen already simplifies `MaybeUninit<T>` and `ManuallyDrop<T>` to `T`. This adds `Pin<T>` as well.
33 lines
386 B
C++
33 lines
386 B
C++
#if 0
|
|
''' '
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
template <typename T>
|
|
using Pin = T;
|
|
template <typename T>
|
|
using Box = T*;
|
|
#endif
|
|
|
|
#if 0
|
|
' '''
|
|
#endif
|
|
|
|
|
|
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <ostream>
|
|
#include <new>
|
|
|
|
struct PinTest {
|
|
Pin<Box<int32_t>> pinned_box;
|
|
Pin<int32_t*> pinned_ref;
|
|
};
|
|
|
|
extern "C" {
|
|
|
|
void root(Pin<int32_t*> s, PinTest p);
|
|
|
|
} // extern "C"
|