aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src
diff options
context:
space:
mode:
authorFenrir <[email protected]>2017-11-18 17:47:38 -0700
committerFenrirWolf <[email protected]>2017-11-18 18:20:21 -0700
commit9f5d769afabc3bcaddf56568aced0df74a5fced6 (patch)
tree41013f073f308aec847f143277904dd930008803 /ctr-std/src
parentMerge pull request #44 from FenrirWolf/panic-unwind (diff)
downloadctru-rs-9f5d769afabc3bcaddf56568aced0df74a5fced6.tar.xz
ctru-rs-9f5d769afabc3bcaddf56568aced0df74a5fced6.zip
Update bindings for libctru v1.4.0
Diffstat (limited to 'ctr-std/src')
-rw-r--r--ctr-std/src/panicking.rs7
-rw-r--r--ctr-std/src/sys/unix/condvar.rs29
2 files changed, 16 insertions, 20 deletions
diff --git a/ctr-std/src/panicking.rs b/ctr-std/src/panicking.rs
index 7047334..082b0de 100644
--- a/ctr-std/src/panicking.rs
+++ b/ctr-std/src/panicking.rs
@@ -431,8 +431,7 @@ fn default_hook(info: &PanicInfo) {
// 3DS-specific code begins here
- use libctru::{errorInit, errorText, errorDisp,
- errorConf, errorType, CFG_Language};
+ use libctru::{errorInit, errorText, errorDisp, errorConf};
use libc;
let thread = thread_info::current_thread();
@@ -447,8 +446,8 @@ fn default_hook(info: &PanicInfo) {
let mut error_conf: errorConf = mem::uninitialized();
errorInit(&mut error_conf,
- errorType::ERROR_TEXT_WORD_WRAP,
- CFG_Language::CFG_LANGUAGE_EN);
+ ::libctru::ERROR_TEXT_WORD_WRAP,
+ ::libctru::CFG_LANGUAGE_EN);
errorText(&mut error_conf, error_text.as_ptr() as *const libc::c_char);
// Display error
diff --git a/ctr-std/src/sys/unix/condvar.rs b/ctr-std/src/sys/unix/condvar.rs
index b32298c..938df8f 100644
--- a/ctr-std/src/sys/unix/condvar.rs
+++ b/ctr-std/src/sys/unix/condvar.rs
@@ -17,11 +17,8 @@ use time::Duration;
use sys::mutex::{self, Mutex};
-use libctru::{__sync_get_arbiter, LightLock};
-use libctru::{svcArbitrateAddress, ArbitrationType};
-
pub struct Condvar {
- lock: UnsafeCell<*mut LightLock>,
+ lock: UnsafeCell<*mut ::libctru::LightLock>,
}
unsafe impl Send for Condvar {}
@@ -42,11 +39,11 @@ impl Condvar {
#[inline]
pub fn notify_one(&self) {
unsafe {
- let arbiter = __sync_get_arbiter();
+ let arbiter = ::libctru::__sync_get_arbiter();
- svcArbitrateAddress(arbiter,
+ ::libctru::svcArbitrateAddress(arbiter,
*self.lock.get() as u32,
- ArbitrationType::ARBITRATION_SIGNAL,
+ ::libctru::ARBITRATION_SIGNAL,
1,
0);
}
@@ -61,11 +58,11 @@ impl Condvar {
return;
}
- let arbiter = __sync_get_arbiter();
+ let arbiter = ::libctru::__sync_get_arbiter();
- svcArbitrateAddress(arbiter,
+ ::libctru::svcArbitrateAddress(arbiter,
*self.lock.get() as u32,
- ArbitrationType::ARBITRATION_SIGNAL,
+ ::libctru::ARBITRATION_SIGNAL,
-1,
0);
}
@@ -86,11 +83,11 @@ impl Condvar {
mutex.unlock();
- let arbiter = __sync_get_arbiter();
+ let arbiter = ::libctru::__sync_get_arbiter();
- svcArbitrateAddress(arbiter,
+ ::libctru::svcArbitrateAddress(arbiter,
*self.lock.get() as u32,
- ArbitrationType::ARBITRATION_WAIT_IF_LESS_THAN,
+ ::libctru::ARBITRATION_WAIT_IF_LESS_THAN,
2,
0);
@@ -119,11 +116,11 @@ impl Condvar {
mutex.unlock();
- let arbiter = __sync_get_arbiter();
+ let arbiter = ::libctru::__sync_get_arbiter();
- svcArbitrateAddress(arbiter,
+ ::libctru::svcArbitrateAddress(arbiter,
*self.lock.get() as u32,
- ArbitrationType::ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,
+ ::libctru::ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT,
2,
nanos as i64);