Skip to content

Commit

Permalink
Fix for link error "Undefined symbols for architecture x86_64: _CFMut…
Browse files Browse the repository at this point in the history
…ableAttributedStringGetTypeID"
  • Loading branch information
vbadanov committed Feb 21, 2020
1 parent 096f217 commit aa6d1cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 0 additions & 1 deletion core-foundation-sys/src/attributed_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ extern {
value: CFTypeRef,
);

pub fn CFMutableAttributedStringGetTypeID() -> CFTypeID;
}
15 changes: 14 additions & 1 deletion core-foundation/src/attributed_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl CFAttributedString {
declare_TCFType!{
CFMutableAttributedString, CFMutableAttributedStringRef
}
impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFMutableAttributedStringGetTypeID);
impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFAttributedStringGetTypeID);

impl CFMutableAttributedString {
#[inline]
Expand Down Expand Up @@ -83,3 +83,16 @@ impl Default for CFMutableAttributedString {
Self::new()
}
}


#[cfg(test)]
mod tests {
use super::*;

#[test]
fn attributed_string_type_id_comparison() {
// CFMutableAttributedString TypeID must be equal to CFAttributedString TypeID.
// Compilation must not fail.
assert_eq!(<CFAttributedString as TCFType>::type_id(), <CFMutableAttributedString as TCFType>::type_id());
}
}

0 comments on commit aa6d1cd

Please sign in to comment.