Fix no_std on redox
Apparently a root-level cfg does not go well with a root-level no_std
This commit is contained in:
+2
-2
@@ -32,7 +32,7 @@ pub extern crate unistd;
|
||||
pub extern crate wchar;
|
||||
pub extern crate wctype;
|
||||
|
||||
#[cfg(not(any(test, target_os = "redox")))]
|
||||
#[cfg(not(test))]
|
||||
#[panic_implementation]
|
||||
#[linkage = "weak"]
|
||||
#[no_mangle]
|
||||
@@ -51,7 +51,7 @@ pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
|
||||
#[linkage = "weak"]
|
||||
pub extern "C" fn rust_eh_personality() {}
|
||||
|
||||
#[cfg(not(any(test, target_os = "redox")))]
|
||||
#[cfg(not(test))]
|
||||
#[lang = "oom"]
|
||||
#[linkage = "weak"]
|
||||
#[no_mangle]
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
*
|
||||
!.gitignore
|
||||
+24
-20
@@ -1,28 +1,32 @@
|
||||
//! sys/utsname implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html
|
||||
|
||||
#![no_std]
|
||||
#![cfg(target_os = "linux")]
|
||||
|
||||
extern crate platform;
|
||||
#[cfg(target_os = "linux")]
|
||||
mod inner {
|
||||
extern crate platform;
|
||||
|
||||
use core::ptr;
|
||||
use platform::types::*;
|
||||
use core::ptr;
|
||||
use self::platform::types::*;
|
||||
|
||||
const LENGTH: usize = 65;
|
||||
const LENGTH: usize = 65;
|
||||
|
||||
#[allow(non_camel_case)]
|
||||
#[no_mangle]
|
||||
#[repr(C)]
|
||||
pub struct utsname {
|
||||
pub sysname: [c_char; LENGTH],
|
||||
pub nodename: [c_char; LENGTH],
|
||||
pub release: [c_char; LENGTH],
|
||||
pub version: [c_char; LENGTH],
|
||||
pub machine: [c_char; LENGTH],
|
||||
pub domainname: [c_char; LENGTH]
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn uname(uts: *mut utsname) -> c_int {
|
||||
platform::uname(uts as usize)
|
||||
#[allow(non_camel_case)]
|
||||
#[no_mangle]
|
||||
#[repr(C)]
|
||||
pub struct utsname {
|
||||
pub sysname: [c_char; LENGTH],
|
||||
pub nodename: [c_char; LENGTH],
|
||||
pub release: [c_char; LENGTH],
|
||||
pub version: [c_char; LENGTH],
|
||||
pub machine: [c_char; LENGTH],
|
||||
pub domainname: [c_char; LENGTH]
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn uname(uts: *mut utsname) -> c_int {
|
||||
platform::uname(uts as usize)
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
pub use inner::*;
|
||||
|
||||
Reference in New Issue
Block a user