|
9 | 9 | // except according to those terms.
|
10 | 10 |
|
11 | 11 | #![crate_name = "libc"]
|
12 |
| -#![experimental] |
13 |
| -#![no_std] // we don't need std, and we can't have std, since it doesn't exist |
14 |
| - // yet. std depends on us. |
15 | 12 | #![crate_type = "rlib"]
|
| 13 | +#![cfg_attr(not(feature = "cargo-build"), experimental)] |
| 14 | +#![no_std] |
16 | 15 | #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
17 | 16 | html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
18 | 17 | html_root_url = "http://doc.rust-lang.org/nightly/",
|
|
70 | 69 | //! in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final
|
71 | 70 | //! one from Berkeley after the lawsuits died down and the CSRG dissolved.
|
72 | 71 |
|
73 |
| -#![allow(non_camel_case_types)] |
74 |
| -#![allow(non_snake_case)] |
75 |
| -#![allow(non_upper_case_globals)] |
76 |
| -#![allow(missing_docs)] |
77 |
| -#![allow(non_snake_case)] |
78 |
| -#![allow(raw_pointer_derive)] |
| 72 | +#![allow(bad_style, raw_pointer_derive)] |
79 | 73 |
|
80 |
| -extern crate core; |
| 74 | +#[cfg(feature = "cargo-build")] extern crate "std" as core; |
| 75 | +#[cfg(not(feature = "cargo-build"))] extern crate core; |
81 | 76 |
|
82 | 77 | #[cfg(test)] extern crate std;
|
83 | 78 | #[cfg(test)] extern crate test;
|
84 | 79 |
|
85 |
| -pub use self::Nullable::*; |
86 |
| - |
87 | 80 | // Explicit export lists for the intersection (provided here) mean that
|
88 | 81 | // you can write more-platform-agnostic code if you stick to just these
|
89 | 82 | // symbols.
|
@@ -311,14 +304,6 @@ pub use types::os::arch::extra::{mach_timebase_info};
|
311 | 304 | #[link(name = "m")]
|
312 | 305 | extern {}
|
313 | 306 |
|
314 |
| -/// A wrapper for a nullable pointer. Don't use this except for interacting |
315 |
| -/// with libc. Basically Option, but without the dependence on libstd. |
316 |
| -// If/when libprim happens, this can be removed in favor of that |
317 |
| -pub enum Nullable<T> { |
318 |
| - Null, |
319 |
| - NotNull(T) |
320 |
| -} |
321 |
| - |
322 | 307 | pub mod types {
|
323 | 308 |
|
324 | 309 | // Types tend to vary *per architecture* so we pull their definitions out
|
@@ -4648,7 +4633,7 @@ pub mod funcs {
|
4648 | 4633 | extern {
|
4649 | 4634 | pub fn glob(pattern: *const c_char,
|
4650 | 4635 | flags: c_int,
|
4651 |
| - errfunc: ::Nullable<extern "C" fn(epath: *const c_char, |
| 4636 | + errfunc: ::core::option::Option<extern "C" fn(epath: *const c_char, |
4652 | 4637 | errno: c_int) -> c_int>,
|
4653 | 4638 | pglob: *mut glob_t);
|
4654 | 4639 | pub fn globfree(pglob: *mut glob_t);
|
|
0 commit comments