From fbfe34605c584b420eeb606ed50e6acbf4b6f1b9 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 23 May 2023 21:33:11 +0200 Subject: [PATCH] Update bindings to latest libctru --- ctru-rs/Cargo.toml | 2 +- ctru-sys/Cargo.toml | 2 +- ctru-sys/src/bindings.rs | 4 ++-- ctru-sys/src/lib.rs | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index 0141c39..2811900 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -13,7 +13,7 @@ name = "ctru" [dependencies] cfg-if = "1.0" -ctru-sys = { path = "../ctru-sys", version = "22.0" } +ctru-sys = { path = "../ctru-sys", version = "22.2" } const-zero = "0.1.0" shim-3ds = { git = "https://github.com/rust3ds/shim-3ds.git" } pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index 7cdbcef..d4cb24b 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ctru-sys" -version = "22.0.0+2.2.0" +version = "22.2.0+2.2.2-1" authors = [ "Rust3DS Org", "Ronald Kinard " ] license = "Zlib" links = "ctru" diff --git a/ctru-sys/src/bindings.rs b/ctru-sys/src/bindings.rs index cb05bfe..fc480d8 100644 --- a/ctru-sys/src/bindings.rs +++ b/ctru-sys/src/bindings.rs @@ -4486,7 +4486,7 @@ impl Default for ConsoleFont { } } } -#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n \n \t//Font:\n \t\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t,\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n ;\n "] +#[doc = " Console structure used to store the state of a console render context.\n\n Default values from consoleGetDefault();\n PrintConsole defaultConsole =\n {\n \t//Font:\n \t{\n \t\t(u8*)default_font_bin, //font gfx\n \t\t0, //first ascii character in the set\n \t\t128, //number of characters in the font set\n\t},\n\t0,0, //cursorX cursorY\n\t0,0, //prevcursorX prevcursorY\n\t40, //console width\n\t30, //console height\n\t0, //window x\n\t0, //window y\n\t32, //window width\n\t24, //window height\n\t3, //tab size\n\t0, //font character offset\n\t0, //print callback\n\tfalse //console initialized\n };\n "] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PrintConsole { @@ -8127,7 +8127,7 @@ extern "C" { } extern "C" { #[must_use] - #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] + #[doc = " Gets an handle to the end of conversion event.\n # Arguments\n\n* `end_event` - Pointer to the event handle to be set to the end of conversion event. It isn't necessary to create or close this handle.\n\n To enable this event you have to use C} Y2RU_SetTransferEndInterrupt(true);The event will be triggered when the corresponding interrupt is fired.\n\n > **Note:** It is recommended to use a timeout when waiting on this event, as it sometimes (but rarely) isn't triggered."] pub fn Y2RU_GetTransferEndEvent(end_event: *mut Handle) -> Result; } extern "C" { diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 595cbd3..7c8aa18 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -12,8 +12,11 @@ pub use bindings::*; pub use result::*; /// In lieu of a proper errno function exposed by libc -/// (), this will retrieve the -/// last error set in the global reentrancy struct. +/// (). pub unsafe fn errno() -> s32 { - (*__getreent())._errno + *__errno() +} + +extern "C" { + fn __errno() -> *mut libc::c_int; }