diff options
| author | Corey Richardson <corey@octayn.net> | 2014-02-26 12:58:41 -0500 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-04 09:31:44 -0700 |
| commit | 0459ee77d0c764cc27950465cb19053e1456cc95 (patch) | |
| tree | 9fa60ca3a09b8bf87bcd9a53ca3c673f84610e5c /src/liblibc | |
| parent | 06ad5eb459f1072d79a815210d69af55ef174d20 (diff) | |
Fix fallout from std::libc separation
Diffstat (limited to 'src/liblibc')
| -rw-r--r-- | src/liblibc/lib.rs | 74 |
1 files changed, 29 insertions, 45 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index bf2baf95b84..00aee1d17dc 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -8,26 +8,32 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(globs)]; -#[crate_id = "libc#0.10-pre"]; -#[experimental]; +#![feature(globs)] +#![crate_id = "libc#0.10-pre"] +#![experimental] +#![no_std] // we don't need std, and we can't have std, since it doesn't exist + // yet. std depends on us. +#![crate_type = "rlib"] +#![crate_type = "dylib"] /*! * Bindings for the C standard library and other platform libraries * -* This module contains bindings to the C standard library, -* organized into modules by their defining standard. -* Additionally, it contains some assorted platform-specific definitions. -* For convenience, most functions and types are reexported from `libc`, -* so `pub use std::*` will import the available -* C bindings as appropriate for the target platform. The exact -* set of functions available are platform specific. +* **NOTE:** These are *architecture and libc* specific. On Linux, these +* bindings are only correct for glibc. * -* *Note* Because these definitions are platform-specific, some may not appear in -* the generated documentation. +* This module contains bindings to the C standard library, organized into +* modules by their defining standard. Additionally, it contains some assorted +* platform-specific definitions. For convenience, most functions and types +* are reexported, so `use libc::*` will import the available C bindings as +* appropriate for the target platform. The exact set of functions available +* are platform specific. * -* We consider the following specs reasonably normative with respect -* to interoperating with the C standard library (libc/msvcrt): +* *Note:* Because these definitions are platform-specific, some may not appear +* in the generated documentation. +* +* We consider the following specs reasonably normative with respect to +* interoperating with the C standard library (libc/msvcrt): * * * ISO 9899:1990 ('C95', 'ANSI C', 'Standard C'), NA1, 1995. * * ISO 9899:1999 ('C99' or 'C9x'). @@ -35,10 +41,10 @@ * * ISO 9945:2001 / IEEE 1003.1-2001 ('POSIX:2001', 'SUSv3'). * * ISO 9945:2008 / IEEE 1003.1-2008 ('POSIX:2008', 'SUSv4'). * -* Note that any reference to the 1996 revision of POSIX, or any revs -* between 1990 (when '88 was approved at ISO) and 2001 (when the next -* actual revision-revision happened), are merely additions of other -* chapters (1b and 1c) outside the core interfaces. +* Note that any reference to the 1996 revision of POSIX, or any revs between +* 1990 (when '88 was approved at ISO) and 2001 (when the next actual +* revision-revision happened), are merely additions of other chapters (1b and +* 1c) outside the core interfaces. * * Despite having several names each, these are *reasonably* coherent * point-in-time, list-of-definition sorts of specs. You can get each under a @@ -55,15 +61,13 @@ * sanity while editing, filling-in-details and eliminating duplication) into * definitions common-to-all (held in modules named c95, c99, posix88, posix01 * and posix08) and definitions that appear only on *some* platforms (named -* 'extra'). This would be things like significant OSX foundation kit, or -* win32 library kernel32.dll, or various fancy glibc, linux or BSD -* extensions. +* 'extra'). This would be things like significant OSX foundation kit, or win32 +* library kernel32.dll, or various fancy glibc, linux or BSD extensions. * * In addition to the per-platform 'extra' modules, we define a module of * 'common BSD' libc routines that never quite made it into POSIX but show up -* in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the -* final one from Berkeley after the lawsuits died down and the CSRG -* dissolved. +* in multiple derived systems. This is the 4.4BSD r2 / 1995 release, the final +* one from Berkeley after the lawsuits died down and the CSRG dissolved. */ #![allow(non_camel_case_types)] @@ -997,7 +1001,6 @@ pub mod types { pub mod bsd44 { } pub mod extra { - use ptr; use consts::os::extra::{MAX_PROTOCOL_CHAIN, WSAPROTOCOL_LEN}; use types::common::c95::c_void; @@ -1102,24 +1105,6 @@ pub mod types { } pub type LPSYSTEM_INFO = *mut SYSTEM_INFO; - impl SYSTEM_INFO { - pub fn new() -> SYSTEM_INFO { - SYSTEM_INFO { - wProcessorArchitecture: 0, - wReserved: 0, - dwPageSize: 0, - lpMinimumApplicationAddress: ptr::mut_null(), - lpMaximumApplicationAddress: ptr::mut_null(), - dwActiveProcessorMask: 0, - dwNumberOfProcessors: 0, - dwProcessorType: 0, - dwAllocationGranularity: 0, - wProcessorLevel: 0, - wProcessorRevision: 0 - } - } - } - pub struct MEMORY_BASIC_INFORMATION { pub BaseAddress: LPVOID, pub AllocationBase: LPVOID, @@ -3901,12 +3886,11 @@ pub mod funcs { pub mod glob { use types::os::arch::c95::{c_char, c_int}; use types::os::common::posix01::{glob_t}; - use Nullable; extern { pub fn glob(pattern: *c_char, flags: c_int, - errfunc: Nullable<extern "C" fn(epath: *c_char, errno: int) -> int>, + errfunc: ::Nullable<extern "C" fn(epath: *c_char, errno: int) -> int>, pglob: *mut glob_t); pub fn globfree(pglob: *mut glob_t); } |
