aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Lesnikov <ozkriff@gmail.com>2015-01-08 20:57:04 +0300
committerAndrey Lesnikov <ozkriff@gmail.com>2015-01-08 20:57:04 +0300
commitdbe38ff49ade182711e1cb275b1af2d3eecae663 (patch)
tree21d476709df58871306fe2d737e08d60c6d0e835
parent181e4a1d8f12136c73add790003f3372319f82f6 (diff)
downloadglutin-dbe38ff49ade182711e1cb275b1af2d3eecae663.tar.gz
glutin-dbe38ff49ade182711e1cb275b1af2d3eecae663.zip
android: Updated for Rust ea6f65c5f 2015-01-06
-rw-r--r--src/android/mod.rs8
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 ()
}
}