diff --git a/Cargo.toml b/Cargo.toml index 88c95e4..5bb72dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "core-graphics" description = "Bindings to Core Graphics for OS X" homepage = "https://github.com/servo/core-graphics-rs" repository = "https://github.com/servo/core-graphics-rs" -version = "0.9.0" +version = "0.9.1" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" diff --git a/src/base.rs b/src/base.rs index 9cfb0a9..5b8e71c 100644 --- a/src/base.rs +++ b/src/base.rs @@ -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; diff --git a/src/color_space.rs b/src/color_space.rs index 10a728a..20764c3 100644 --- a/src/color_space.rs +++ b/src/color_space.rs @@ -10,8 +10,9 @@ use core_foundation::base::{CFRelease, CFRetain, CFTypeID, CFTypeRef, TCFType}; use std::mem; -#[repr(C)] -pub struct __CGColorSpace; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CGColorSpace {} pub type CGColorSpaceRef = *const __CGColorSpace; diff --git a/src/context.rs b/src/context.rs index 3347bf5..d6c44d3 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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; diff --git a/src/data_provider.rs b/src/data_provider.rs index aaa5f75..9cead2c 100644 --- a/src/data_provider.rs +++ b/src/data_provider.rs @@ -26,8 +26,9 @@ pub type CGDataProviderReleaseBytePointerCallback = Option; pub type CGDataProviderGetBytesAtPositionCallback = Option; -#[repr(C)] -pub struct __CGDataProvider; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CGDataProvider {} pub type CGDataProviderRef = *const __CGDataProvider; diff --git a/src/event.rs b/src/event.rs index d43905c..d94b270 100644 --- a/src/event.rs +++ b/src/event.rs @@ -12,6 +12,7 @@ pub type CGKeyCode = libc::uint16_t; /// /// [Ref](http://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-700/IOHIDSystem/IOKit/hidsystem/IOLLEvent.h) bitflags! { + #[repr(C)] pub struct CGEventFlags: u64 { const CGEventFlagNull = 0; @@ -88,8 +89,9 @@ pub enum CGEventTapLocation { AnnotatedSession, } -#[repr(C)] -pub struct __CGEvent; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CGEvent {} pub type CGEventRef = *const __CGEvent; diff --git a/src/event_source.rs b/src/event_source.rs index 32bbaef..c38aca9 100644 --- a/src/event_source.rs +++ b/src/event_source.rs @@ -12,8 +12,9 @@ pub enum CGEventSourceStateID { HIDSystemState = 1, } -#[repr(C)] -pub struct __CGEventSource; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CGEventSource {} pub type CGEventSourceRef = *const __CGEventSource; diff --git a/src/font.rs b/src/font.rs index 3c1c390..00d3b89 100644 --- a/src/font.rs +++ b/src/font.rs @@ -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; diff --git a/src/image.rs b/src/image.rs index aea7742..b355870 100644 --- a/src/image.rs +++ b/src/image.rs @@ -27,8 +27,9 @@ pub enum CGImageByteOrderInfo { CGImageByteOrder32Big = (4 << 12) } -#[repr(C)] -pub struct __CGImage; +// This is an enum due to zero-sized types warnings. +// For more details see https://github.com/rust-lang/rust/issues/27303 +pub enum __CGImage {} pub type CGImageRef = *const __CGImage; diff --git a/src/lib.rs b/src/lib.rs index daed628..bfba026 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,6 @@ // except according to those terms. extern crate libc; -#[macro_use] extern crate core_foundation; #[macro_use]