Change sdl2-sys to #![no_std]

This commit is contained in:
Nicholas Mazzuca
2015-03-16 09:57:26 -07:00
parent 5ca4bfbc78
commit 977ca54893
8 changed files with 15 additions and 10 deletions
+3 -6
View File
@@ -1,3 +1,4 @@
use core::prelude::*;
use libc::{c_int, c_uint, c_void, uint8_t, uint32_t};
use libc::{uint16_t, c_double, c_char};
use super::rwops::SDL_RWops;
@@ -24,9 +25,7 @@ pub const AUDIO_S32SYS : SDL_AudioFormat = AUDIO_S32LSB;
pub const AUDIO_F32SYS : SDL_AudioFormat = AUDIO_F32LSB;
pub type SDL_AudioCallback =
::std::option::Option<extern "C" fn
(arg1: *const c_void, arg2: *const uint8_t,
arg3: c_int)>;
Option<extern "C" fn (arg1: *const c_void, arg2: *const uint8_t, arg3: c_int)>;
#[allow(missing_copy_implementations)]
#[repr(C)]
pub struct SDL_AudioSpec {
@@ -41,9 +40,7 @@ pub struct SDL_AudioSpec {
pub userdata: *const c_void,
}
pub type SDL_AudioFilter =
::std::option::Option<extern "C" fn
(arg1: *const SDL_AudioCVT,
arg2: SDL_AudioFormat)>;
Option<extern "C" fn (arg1: *const SDL_AudioCVT, arg2: SDL_AudioFormat)>;
#[allow(dead_code, missing_copy_implementations, raw_pointer_derive)]
#[derive(Copy)]
#[repr(C)]
+1
View File
@@ -1,3 +1,4 @@
use core::prelude::*;
use libc::{c_int, c_char, c_uchar, c_uint, c_void, int16_t, uint8_t};
use joystick::{SDL_Joystick, SDL_JoystickGUID};
+1
View File
@@ -6,6 +6,7 @@ use gesture::SDL_GestureID;
use keyboard::SDL_Keysym;
use touch::SDL_FingerID;
use touch::SDL_TouchID;
use core::prelude::*;
pub type SDL_bool = c_int;
+1
View File
@@ -1,4 +1,5 @@
use joystick::SDL_Joystick;
use core::prelude::*;
use libc::{c_int, c_uint, c_char, c_float, c_void, int16_t, int32_t, uint8_t, uint16_t, uint32_t};
pub const SDL_HAPTIC_CONSTANT: uint16_t = 1 << 0;
+3
View File
@@ -1,6 +1,9 @@
#![feature(no_std, core)]
#![no_std]
#![allow(non_camel_case_types)]
extern crate libc;
extern crate core;
pub mod scancode;
pub mod keycode;
+3 -2
View File
@@ -2,7 +2,8 @@
Rectangle Functions
*/
use std::mem;
use core::prelude::*;
use core::intrinsics::transmute;
use libc::c_int;
/// A structure that defines a two dimensional point.
@@ -71,7 +72,7 @@ impl Rect {
ll::SDL_EnclosePoints(
points.as_ptr(),
points.len() as c_int,
mem::transmute(clip.as_ref()),
transmute(clip.as_ref()),
&out
) != 0
};
+2 -2
View File
@@ -1,9 +1,9 @@
use core::prelude::*;
use libc::{uint32_t, uint64_t, c_void, c_int};
//SDL_timer.h
pub type SDL_TimerCallback =
::std::option::Option<extern "C" fn(arg1: uint32_t, arg2: *const c_void)
-> uint32_t>;
Option<extern "C" fn(arg1: uint32_t, arg2: *const c_void) -> uint32_t>;
pub type SDL_TimerID = c_int;
extern "C" {
pub fn SDL_GetTicks() -> uint32_t;
+1
View File
@@ -1,6 +1,7 @@
use rect::Rect;
use surface::SDL_Surface;
use core::prelude::*;
use libc::{c_void, c_int, c_float, c_char, uint16_t, uint32_t};
pub type SDL_Rect = Rect;