Skip to content
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

Switch to using C FFI types in core (Rust 1.64.0+) #11

Merged
merged 6 commits into from
Sep 28, 2022

Conversation

zec
Copy link
Member

@zec zec commented Sep 28, 2022

Now that Rust 1.64.0 has landed, the C FFI types we need in n2o4 and cfs-sys are available in core::ffi on stable Rust.

This pull request has the following effects:

  • Switches from using libc::c_* to core::ffi::c_*, removing the need for the libc crate as a dependency
  • Genericizes (null-terminated) string parameters beyond just printf_wrap::NullString to any implementer of AsRef<CStr> (as CStr's available in #[no_std] land now)

Resolves #3.

As of Rust 1.64.0, the C types we were using in the `libc` crate are now
available in `core::ffi`; this commit switches to using `core::ffi`.
Similarly to commit 05ee5fc, the types that we were using in
the `libc` crate are available in `core::ffi` as of Rust 1.64.0.
@zec zec self-assigned this Sep 28, 2022
@zec
Copy link
Member Author

zec commented Sep 28, 2022

I took a second look at my changes. Still looks good.

@zec zec merged commit c4d02e2 into BlackCAT-CubeSat:main Sep 28, 2022
@zec zec deleted the ctypes-0928 branch September 28, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make string, C type-related changes upon Rust 1.64.0 release
1 participant