Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace objc with objc2? #513

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Update objc2 to v0.3.0-beta.5
  • Loading branch information
madsmtm committed Jul 31, 2023
commit 1421a5c3d1383c91523ab0c24a4c211eb8000911
5 changes: 2 additions & 3 deletions cocoa-foundation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,10 +12,9 @@ license = "MIT OR Apache-2.0"
default-target = "x86_64-apple-darwin"

[dependencies]
block = { version = "=0.2.0-alpha.7", package = "block2" }
block = { version = "=0.2.0-alpha.8", package = "block2" }
bitflags = "1.0"
libc = "0.2"
core-foundation = { path = "../core-foundation", version = "0.9" }
core-graphics-types = { path = "../core-graphics-types", version = "0.1" }
objc2 = { version = "=0.3.0-beta.4" }
objc2-encode = { version = "=2.0.0-pre.3" }
objc2 = "=0.3.0-beta.5"
9 changes: 3 additions & 6 deletions cocoa-foundation/src/lib.rs
Original file line number Diff line number Diff line change
@@ -15,17 +15,14 @@ extern crate bitflags;
extern crate core_foundation;
extern crate core_graphics_types;
extern crate libc;
pub extern crate objc2_encode;
#[macro_use]
extern crate objc2;

pub use objc2_encode as __objc2_encode;
pub extern crate objc2;

#[macro_export]
macro_rules! impl_Encode {
($t:ty, $delegation:ty) => {
unsafe impl $crate::__objc2_encode::Encode for $t {
const ENCODING: $crate::__objc2_encode::Encoding = <$delegation>::ENCODING;
unsafe impl $crate::objc2::encode::Encode for $t {
const ENCODING: $crate::objc2::encode::Encoding = <$delegation>::ENCODING;
}
};
}
4 changes: 2 additions & 2 deletions cocoa/Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,11 +12,11 @@ license = "MIT OR Apache-2.0"
default-target = "x86_64-apple-darwin"

[dependencies]
block = { version = "=0.2.0-alpha.7", package = "block2" }
block = { version = "=0.2.0-alpha.8", package = "block2" }
bitflags = "1.0"
libc = "0.2"
cocoa-foundation = { path = "../cocoa-foundation", version = "0.1" }
core-foundation = { path = "../core-foundation", version = "0.9" }
core-graphics = { path = "../core-graphics", version = "0.23" }
foreign-types = "0.5"
objc2 = { version = "=0.3.0-beta.4" }
objc2 = "=0.3.0-beta.5"
2 changes: 1 addition & 1 deletion core-foundation-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0"

[dependencies]
objc2-encode = { version = "=2.0.0-pre.3" }
objc2 = "=0.3.0-beta.5"

[features]
mac_os_10_7_support = [] # backwards compatibility
4 changes: 2 additions & 2 deletions core-foundation-sys/src/array.rs
Original file line number Diff line number Diff line change
@@ -36,8 +36,8 @@ pub struct __CFArray(c_void);
pub type CFArrayRef = *const __CFArray;
pub type CFMutableArrayRef = *mut __CFArray;

unsafe impl ::objc2_encode::RefEncode for __CFArray {
const ENCODING_REF: ::objc2_encode::Encoding = ::objc2_encode::Encoding::Object;
unsafe impl ::objc2::encode::RefEncode for __CFArray {
const ENCODING_REF: ::objc2::encode::Encoding = ::objc2::encode::Encoding::Object;
}

extern "C" {
4 changes: 2 additions & 2 deletions core-foundation-sys/src/attributed_string.rs
Original file line number Diff line number Diff line change
@@ -19,8 +19,8 @@ pub struct __CFAttributedString(c_void);
pub type CFAttributedStringRef = *const __CFAttributedString;
pub type CFMutableAttributedStringRef = *mut __CFAttributedString;

unsafe impl ::objc2_encode::RefEncode for __CFAttributedString {
const ENCODING_REF: ::objc2_encode::Encoding = ::objc2_encode::Encoding::Object;
unsafe impl ::objc2::encode::RefEncode for __CFAttributedString {
const ENCODING_REF: ::objc2::encode::Encoding = ::objc2::encode::Encoding::Object;
}

extern "C" {
4 changes: 2 additions & 2 deletions core-foundation-sys/src/dictionary.rs
Original file line number Diff line number Diff line change
@@ -51,8 +51,8 @@ pub struct __CFDictionary(c_void);
pub type CFDictionaryRef = *const __CFDictionary;
pub type CFMutableDictionaryRef = *mut __CFDictionary;

unsafe impl ::objc2_encode::RefEncode for __CFDictionary {
const ENCODING_REF: ::objc2_encode::Encoding = ::objc2_encode::Encoding::Object;
unsafe impl ::objc2::encode::RefEncode for __CFDictionary {
const ENCODING_REF: ::objc2::encode::Encoding = ::objc2::encode::Encoding::Object;
}

extern "C" {
2 changes: 1 addition & 1 deletion core-foundation-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
feature(linkage)
)] // back-compat requires weak linkage

extern crate objc2_encode;
extern crate objc2;

// Link to CoreFoundation on any Apple device.
//
4 changes: 2 additions & 2 deletions core-foundation-sys/src/string.rs
Original file line number Diff line number Diff line change
@@ -206,8 +206,8 @@ pub fn CFStringInitInlineBuffer(str: CFStringRef, buf: *mut CFStringInlineBuffer
pub fn CFStringGetCharacterFromInlineBuffer(buf: *mut CFStringInlineBuffer, idx: CFIndex) -> UniChar;
*/

unsafe impl ::objc2_encode::RefEncode for __CFString {
const ENCODING_REF: ::objc2_encode::Encoding = ::objc2_encode::Encoding::Object;
unsafe impl ::objc2::encode::RefEncode for __CFString {
const ENCODING_REF: ::objc2::encode::Encoding = ::objc2::encode::Encoding::Object;
}

extern "C" {
2 changes: 1 addition & 1 deletion core-graphics-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
bitflags = "1.0"
core-foundation = { path = "../core-foundation", version = "0.9" }
libc = "0.2"
objc2-encode = { version = "=2.0.0-pre.3" }
objc2 = "=0.3.0-beta.5"

[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
2 changes: 1 addition & 1 deletion core-graphics-types/src/geometry.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
use base::CGFloat;
use core_foundation::base::TCFType;
use core_foundation::dictionary::CFDictionary;
use objc2_encode::{Encode, Encoding};
use objc2::encode::{Encode, Encoding};

pub const CG_ZERO_POINT: CGPoint = CGPoint { x: 0.0, y: 0.0 };

2 changes: 1 addition & 1 deletion core-graphics-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
// except according to those terms.

extern crate core_foundation;
extern crate objc2_encode;
extern crate objc2;

pub mod base;
pub mod geometry;
2 changes: 1 addition & 1 deletion core-graphics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ core-foundation = { path = "../core-foundation", version = "0.9" }
core-graphics-types = { path = "../core-graphics-types", version = "0.1" }
foreign-types = "0.5.0"
libc = "0.2"
objc2-encode = { version = "=2.0.0-pre.3" }
objc2 = "=0.3.0-beta.5"

[package.metadata.docs.rs]
default-target = "x86_64-apple-darwin"
2 changes: 1 addition & 1 deletion core-graphics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
// except according to those terms.

extern crate libc;
extern crate objc2_encode;
extern crate objc2;

#[macro_use]
extern crate core_foundation;
2 changes: 1 addition & 1 deletion core-graphics/src/sys.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::os::raw::c_void;

use objc2_encode::{Encoding, RefEncode};
use objc2::encode::{Encoding, RefEncode};

pub enum CGImage {}
pub type CGImageRef = *mut CGImage;