Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for link error - undefined CFMutableAttributedStringGetTypeID #357

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}