2
0

struct.rs 536 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. use std::marker::PhantomData;
  2. struct Opaque {
  3. x: i32,
  4. y: f32,
  5. }
  6. #[repr(C)]
  7. struct Normal {
  8. x: i32,
  9. y: f32,
  10. }
  11. #[repr(C)]
  12. struct NormalWithZST {
  13. x: i32,
  14. y: f32,
  15. z: (),
  16. w: PhantomData<i32>,
  17. v: PhantomPinned,
  18. }
  19. /// cbindgen:rename-all=GeckoCase
  20. #[repr(C)]
  21. struct TupleRenamed(i32, f32);
  22. /// cbindgen:field-names=[x, y]
  23. #[repr(C)]
  24. struct TupleNamed(i32, f32);
  25. #[no_mangle]
  26. pub extern "C" fn root(
  27. a: *mut Opaque,
  28. b: Normal,
  29. c: NormalWithZST,
  30. d: TupleRenamed,
  31. e: TupleNamed
  32. ) { }