-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bindgen-ctru-sys
package and update bindings
#110
Conversation
- Added the `bindgen-ctru-sys` to be able to use `ParseCallbacks` when generating the bindings. - Updated `doxygen-rs` to 0.4, which has a faster engine and more extensible internal (even though there are some regressions). - Removes the `docstring-to-rustdoc` package because it is no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks, the new docs seem nicer for sure!
ctru-sys/bindgen.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As more of this is converted to Rust now I almost wonder if we should consider writing the other logic that I just added for libctru
version numbering into bindgen-ctru-sys
as well... Doesn't need to be part of this PR just something to think about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be great. That would also allow support for multiple platforms (right now I'm using Windows and I had to run the commands manually because the script couldn't determine my version due to the need of pacman, which of course I don't have)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah man, I had been wondering about Windows support with that script, but don't have a Windows environment handy for testing it (and couldn't get Wine to work either).
I opened #113 to track this.
A new release of libctru has been released: https://github.com/devkitPro/libctru/releases/tag/v2.2.0 You should update the bindings and change the version of |
As of #101 we also need to bump the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ian-h-chamberlain __getreent
has been moved to newlib
. As such, it doesn’t appear in the bindings anymore. Since it’s not available on libc
either, maybe we should add it to ctru-sys’ lib.rs
?
Hmmm, we could, I suppose... It looks like the only reason we use it today is for extern "C" {
unsafe fn __errno() -> *mut libc::c_int;
} Or we could even just include @@ -22929,3 +23016,13 @@ extern "C" {
#[doc = ""]
pub fn link3dsConnectToHost(redirStdout: bool, redirStderr: bool) -> ::libc::c_int;
}
+pub type error_t = ::libc::c_int;
+extern "C" {
+ pub fn __errno() -> *mut ::libc::c_int;
+}
+extern "C" {
+ pub static _sys_errlist: [*const ::libc::c_char; 0usize];
+}
+extern "C" {
+ pub static mut _sys_nerr: ::libc::c_int;
+} |
I've used the citro3d-rs repo as inspiration for creating the script. This doesn't bring any improvements per se, but I think this is a cleaner approach :)
This also updates
doxygen-rs
to 0.4, which has a new engine that will allow me to more easily start supporting the things that are left. Right now there are some regressions, but the documentations is still completely understandable.Also, thanks to the use of a package to create the bindings, we're able to use
ParseCallbacks
(which is great for the Doxygen conversions, because the previous approach was quite hacky to say the least...)Related #32 #75 rust3ds/citro3d-rs#10