This commit is contained in:
Antonio Scandurra 2022-08-29 19:59:58 +02:00
parent 0df97dce02
commit 30a3c0fb46
3 changed files with 6 additions and 5 deletions

View file

@ -6,7 +6,6 @@ fn main() {
cc::Build::new()
.file("src/dummy.m")
.define("MACOSX_DEPLOYMENT_TARGET", "12.3")
.flag("-ObjC")
.flag("-mmacosx-version-min=12.3")
.compile("dummy");
}

View file

@ -1,4 +1,4 @@
use std::{ffi::CStr, slice, str};
use std::{ffi::CStr, slice, str, ptr};
use block::ConcreteBlock;
use cocoa::{
@ -6,7 +6,7 @@ use cocoa::{
foundation::{NSArray, NSString, NSUInteger, NSInteger},
};
use core_graphics::display::CGDirectDisplayID;
use gpui::{actions, elements::*, keymap::Binding, Menu, MenuItem, mac::dispatcher::dispatch_get_main_queue};
use gpui::{actions, elements::*, keymap::Binding, Menu, MenuItem, mac::dispatcher::{dispatch_get_main_queue, dispatch_queue_create}};
use log::LevelFilter;
use objc::{class, msg_send, sel, sel_impl, declare::ClassDecl, runtime::{Protocol, Object, Sel}};
use simplelog::SimpleLogger;
@ -71,7 +71,8 @@ fn main() {
let stream: id = msg_send![class!(SCStream), alloc];
let stream: id = msg_send![stream, initWithFilter: filter configuration: config delegate: nil];
let error: id = nil;
let _: () = msg_send![stream, addStreamOutput: output type: 0 sampleHandlerQueue: dispatch_get_main_queue() error: &error];
let queue = dispatch_queue_create(ptr::null(), ptr::null_mut());
let _: () = msg_send![stream, addStreamOutput: output type: 0 sampleHandlerQueue: queue error: &error];
let start_capture_completion = ConcreteBlock::new(move |error: id| {
if !error.is_null() {

View file

@ -19,6 +19,7 @@ fn generate_dispatch_bindings() {
.header("src/platform/mac/dispatch.h")
.allowlist_var("_dispatch_main_q")
.allowlist_function("dispatch_async_f")
.allowlist_function("dispatch_queue_create")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.layout_tests(false)
.generate()