Skip to content

Commit

Permalink
Silence deprecation warnings for now
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jul 31, 2023
1 parent 170dcce commit 0eda34d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion cocoa-foundation/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

use objc2::runtime;

pub use objc2::runtime::{BOOL, NO, YES};
pub type BOOL = runtime::BOOL;
pub const NO: BOOL = runtime::NO;
pub const YES: BOOL = runtime::YES;

pub type Class = *mut runtime::Class;
#[allow(non_camel_case_types)]
Expand Down
1 change: 1 addition & 0 deletions cocoa-foundation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// except according to those terms.

#![allow(non_snake_case)]
#![allow(deprecated)] // TODO(madsmtm): Remove this

extern crate block2;
#[macro_use]
Expand Down
7 changes: 3 additions & 4 deletions cocoa/examples/fullscreen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
extern crate cocoa;
extern crate core_graphics;

#[macro_use]
extern crate objc2;

use cocoa::appkit::{
Expand All @@ -17,8 +15,9 @@ use cocoa::foundation::{

use core_graphics::display::CGDisplay;

use objc2::declare::ClassDecl;
use objc2::declare::ClassBuilder;
use objc2::runtime::{Object, Sel};
use objc2::{class, msg_send, sel};

fn main() {
unsafe {
Expand Down Expand Up @@ -48,7 +47,7 @@ fn main() {

// Create NSWindowDelegate
let superclass = class!(NSObject);
let mut decl = ClassDecl::new("MyWindowDelegate", superclass).unwrap();
let mut decl = ClassBuilder::new("MyWindowDelegate", superclass).unwrap();

extern "C" fn will_use_fillscreen_presentation_options(
_: &Object,
Expand Down
2 changes: 1 addition & 1 deletion cocoa/examples/nsvisualeffectview_blur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extern crate cocoa;
extern crate objc2;

use cocoa::base::{nil, selector, NO};
use objc2::*;
use objc2::msg_send;

use cocoa::appkit::{
NSApp, NSApplication, NSApplicationActivationPolicyRegular, NSBackingStoreType, NSColor,
Expand Down
1 change: 1 addition & 0 deletions cocoa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#![crate_name = "cocoa"]
#![crate_type = "rlib"]
#![allow(non_snake_case)]
#![allow(deprecated)] // TODO(madsmtm): Remove this

extern crate block2;
#[macro_use]
Expand Down

0 comments on commit 0eda34d

Please sign in to comment.