Skip to content

Commit

Permalink
Merge pull request tectonic-typesetting#104 from cormacrelf/objc_msgSend
Browse files Browse the repository at this point in the history
use objc crate's msg_send! macro to replace placeholders
  • Loading branch information
crlf0710 authored Sep 26, 2019
2 parents e2cc3e4 + 0ee8d4f commit 72da158
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 106 deletions.
47 changes: 47 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ core-foundation = "0.6.4"
core-graphics = "0.17.3"
core-text = "13.3.0"
freetype-rs = "0.22.0"
# needed for replacing XeTeXFontMgr_Mac
# cocoa = "0.19.0"
objc = "0.2.6"
objc-foundation = "0.1.1"
objc_id = "0.1.1"
5 changes: 5 additions & 0 deletions engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ extern crate tectonic_dvipdfmx as dpx;

pub use bridge::*;

// For the msg_send macro
#[cfg(target_os = "macos")]
#[macro_use]
extern crate objc;

//use log::{info, warn};

pub type __off_t = i64;
Expand Down
9 changes: 5 additions & 4 deletions engine/src/xetex_font_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ use crate::core_memory::xmalloc;

use crate::xetex_layout_interface::collection_types::*;

#[cfg(target_os = "macos")]
use crate::xetex_layout_interface::__CTFontDescriptor;

extern "C" {
#[cfg(target_os = "macos")]
pub type __CTFontDescriptor;
/* ************************************************************************/
/* ************************************************************************/
/* */
Expand Down Expand Up @@ -2567,9 +2568,9 @@ pub unsafe extern "C" fn XeTeXFontMgr_prependToList(
false
}
}

remove_first_occur(&mut *list, CStr::from_ptr(str));

CppStdListOfString_prepend_copy_const_char_ptr(list, str);
}
#[no_mangle]
Expand Down
Loading

0 comments on commit 72da158

Please sign in to comment.