diff options
author | Andrey Lesnikov <ozkriff@gmail.com> | 2015-01-08 20:57:04 +0300 |
---|---|---|
committer | Andrey Lesnikov <ozkriff@gmail.com> | 2015-01-08 20:57:04 +0300 |
commit | dbe38ff49ade182711e1cb275b1af2d3eecae663 (patch) | |
tree | 21d476709df58871306fe2d737e08d60c6d0e835 /src/android | |
parent | 181e4a1d8f12136c73add790003f3372319f82f6 (diff) | |
download | glutin-dbe38ff49ade182711e1cb275b1af2d3eecae663.tar.gz glutin-dbe38ff49ade182711e1cb275b1af2d3eecae663.zip |
android: Updated for Rust ea6f65c5f 2015-01-06
Diffstat (limited to 'src/android')
-rw-r--r-- | src/android/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/android/mod.rs b/src/android/mod.rs index 7e1c35d..0dbe164 100644 --- a/src/android/mod.rs +++ b/src/android/mod.rs @@ -1,6 +1,7 @@ extern crate android_glue; use libc; +use std::ffi::{CString}; use std::sync::mpsc::{Receiver, channel}; use {CreationError, Event, WindowBuilder}; use CreationError::OsError; @@ -257,12 +258,9 @@ impl Window { } pub fn get_proc_address(&self, addr: &str) -> *const () { - use std::c_str::ToCStr; - + let addr = CString::from_slice(addr.as_bytes()).as_slice_with_nul().as_ptr(); unsafe { - addr.with_c_str(|s| { - ffi::egl::GetProcAddress(s) as *const () - }) + ffi::egl::GetProcAddress(addr) as *const () } } |