From aa6d1cd4c15561b48c24322527e3d9e60f603db4 Mon Sep 17 00:00:00 2001 From: Vasiliy Badanov Date: Fri, 21 Feb 2020 23:40:36 +0300 Subject: [PATCH] Fix for link error "Undefined symbols for architecture x86_64: _CFMutableAttributedStringGetTypeID" --- core-foundation-sys/src/attributed_string.rs | 1 - core-foundation/src/attributed_string.rs | 15 ++++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core-foundation-sys/src/attributed_string.rs b/core-foundation-sys/src/attributed_string.rs index ecdffe6..c91bf5b 100644 --- a/core-foundation-sys/src/attributed_string.rs +++ b/core-foundation-sys/src/attributed_string.rs @@ -52,5 +52,4 @@ extern { value: CFTypeRef, ); - pub fn CFMutableAttributedStringGetTypeID() -> CFTypeID; } diff --git a/core-foundation/src/attributed_string.rs b/core-foundation/src/attributed_string.rs index e0fa576..c99775d 100644 --- a/core-foundation/src/attributed_string.rs +++ b/core-foundation/src/attributed_string.rs @@ -41,7 +41,7 @@ impl CFAttributedString { declare_TCFType!{ CFMutableAttributedString, CFMutableAttributedStringRef } -impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFMutableAttributedStringGetTypeID); +impl_TCFType!(CFMutableAttributedString, CFMutableAttributedStringRef, CFAttributedStringGetTypeID); impl CFMutableAttributedString { #[inline] @@ -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!(::type_id(), ::type_id()); + } +} \ No newline at end of file