diff --git a/rust_icu_sys/src/lib.rs b/rust_icu_sys/src/lib.rs index 229bde81..04c25993 100644 --- a/rust_icu_sys/src/lib.rs +++ b/rust_icu_sys/src/lib.rs @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. - +#![doc(test(ignore))] // Notes: // * deref_nullptr: since rustc 1.53, bindgen causes UB warnings -- see // https://github.com/rust-lang/rust-bindgen/issues/1651 remove this once bindgen has fixed the @@ -23,7 +23,7 @@ non_upper_case_globals, unused_imports, rustdoc::bare_urls, - deref_nullptr, + deref_nullptr )] #[cfg(all(feature = "icu_version_in_env", feature = "icu_config"))] @@ -87,7 +87,15 @@ extern crate libc; #[cfg_attr(feature = "static", link(name = "icui18n", kind = "static"))] #[cfg_attr(feature = "static", link(name = "icuuc", kind = "static"))] #[cfg_attr(feature = "static", link(name = "icudata", kind = "static"))] -#[cfg_attr(feature = "static", link(name = "stdc++", kind = "dylib"))] +// On systems such as macOS, libc++ is the default library +#[cfg_attr( + all(target_vendor = "apple", feature = "static"), + link(name = "c++", kind = "dylib") +)] +#[cfg_attr( + not(all(target_vendor = "apple", feature = "static")), + link(name = "stdc++", kind = "dylib") +)] extern "C" {} impl From for UCharCategory { @@ -124,7 +132,7 @@ impl From for UCharCategory { 28 => UCharCategory::U_INITIAL_PUNCTUATION, 29 => UCharCategory::U_FINAL_PUNCTUATION, 30 => UCharCategory::U_CHAR_CATEGORY_COUNT, - _ => { + _ => { panic!("could not convert: {}", value); } }