Remove warnings for zero-sized structs #89.

This follows the servo pattern mentioned in
https://github.com/rust-lang/rust/issues/27303 to replace the zero-sized
structs with an `enum`.
This commit is contained in:
Ryan Thomas
2017-07-27 19:26:54 +01:00
parent aeb81086b5
commit b0b6dcdbaa
3 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -28,7 +28,9 @@ pub type CGFloat = libc::c_float;
pub type CGError = libc::int32_t;
pub type CGAffineTransform = ();
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum CGAffineTransform {}
pub const kCGImageAlphaNone: u32 = 0;
pub const kCGImageAlphaPremultipliedLast: u32 = 1;
+3 -2
View File
@@ -28,8 +28,9 @@ pub enum CGTextDrawingMode {
CGTextClip
}
#[repr(C)]
pub struct __CGContext;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGContext {}
pub type CGContextRef = *const __CGContext;
+3 -2
View File
@@ -17,8 +17,9 @@ use std::ptr;
pub type CGGlyph = libc::c_ushort;
#[repr(C)]
pub struct __CGFont;
// This is an enum due to zero-sized types warnings.
// For more details see https://github.com/rust-lang/rust/issues/27303
pub enum __CGFont {}
pub type CGFontRef = *const __CGFont;