cfg_2.rs 359 B

1234567891011121314151617181920212223242526272829303132
  1. #[cfg(any(windows, unix))]
  2. #[repr(C)]
  3. struct Foo {
  4. x: i32,
  5. }
  6. #[cfg(windows)]
  7. #[repr(C)]
  8. struct Bar {
  9. y: Foo,
  10. }
  11. #[cfg(unix)]
  12. #[repr(C)]
  13. struct Bar {
  14. z: Foo,
  15. }
  16. #[repr(C)]
  17. struct Root {
  18. w: Bar,
  19. }
  20. #[cfg(windows)]
  21. pub const DEFAULT_X: i32 = 0x08;
  22. #[cfg(unix)]
  23. pub const DEFAULT_X: i32 = 0x2a;
  24. #[no_mangle]
  25. pub extern "C" fn root(a: Root)
  26. { }