#![allow(missing_doc)]
use clone::Clone;
+use collections::MutableSeq;
use c_str::ToCStr;
use iter::Iterator;
use mem;
#[cfg(target_os = "linux")]
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
+ #[cfg(target_os = "dragonfly")]
fn test_errors_do_not_crash() {
// Open /dev/null as a library to get an error, and make sure
// that only causes an error, and not a crash.
#[cfg(target_os = "macos")]
#[cfg(target_os = "ios")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
pub mod dl {
- use prelude::*;
use c_str::{CString, ToCStr};
use libc;
use ptr;
use result::*;
- use str::StrAllocating;
use string::String;
pub unsafe fn open_external<T: ToCStr>(filename: T) -> *mut u8 {
let ret = if ptr::null() == last_error {
Ok(result)
} else {
- Err(CString::new(last_error, false).as_str()
- .unwrap()
- .to_string())
+ Err(String::from_str(CString::new(last_error, false).as_str()
+ .unwrap()))
};
ret