Skip to content

Commit 72da158

Browse files
authored
Merge pull request tectonic-typesetting#104 from cormacrelf/objc_msgSend
use objc crate's msg_send! macro to replace placeholders
2 parents e2cc3e4 + 0ee8d4f commit 72da158

6 files changed

Lines changed: 148 additions & 106 deletions

File tree

Cargo.lock

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ core-foundation = "0.6.4"
3636
core-graphics = "0.17.3"
3737
core-text = "13.3.0"
3838
freetype-rs = "0.22.0"
39-
# needed for replacing XeTeXFontMgr_Mac
40-
# cocoa = "0.19.0"
39+
objc = "0.2.6"
40+
objc-foundation = "0.1.1"
41+
objc_id = "0.1.1"

engine/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ extern crate tectonic_dvipdfmx as dpx;
1616

1717
pub use bridge::*;
1818

19+
// For the msg_send macro
20+
#[cfg(target_os = "macos")]
21+
#[macro_use]
22+
extern crate objc;
23+
1924
//use log::{info, warn};
2025

2126
pub type __off_t = i64;

engine/src/xetex_font_manager.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ use crate::core_memory::xmalloc;
2424

2525
use crate::xetex_layout_interface::collection_types::*;
2626

27+
#[cfg(target_os = "macos")]
28+
use crate::xetex_layout_interface::__CTFontDescriptor;
29+
2730
extern "C" {
28-
#[cfg(target_os = "macos")]
29-
pub type __CTFontDescriptor;
3031
/* ************************************************************************/
3132
/* ************************************************************************/
3233
/* */
@@ -2567,9 +2568,9 @@ pub unsafe extern "C" fn XeTeXFontMgr_prependToList(
25672568
false
25682569
}
25692570
}
2570-
2571+
25712572
remove_first_occur(&mut *list, CStr::from_ptr(str));
2572-
2573+
25732574
CppStdListOfString_prepend_copy_const_char_ptr(list, str);
25742575
}
25752576
#[no_mangle]

0 commit comments

Comments
 (0)