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

Remove libc dependencies #284

Merged
merged 9 commits into from
Oct 18, 2022
Merged

Remove libc dependencies #284

merged 9 commits into from
Oct 18, 2022

Conversation

Tacha-S
Copy link
Contributor

@Tacha-S Tacha-S commented Oct 16, 2022

@esteve
Copy link
Collaborator

esteve commented Oct 16, 2022

@Tacha-S this is looking great, thanks! Let us know when it's ready for review

@nnmm nnmm requested a review from a team October 16, 2022 11:18
@Tacha-S
Copy link
Contributor Author

Tacha-S commented Oct 17, 2022

I was developing with 1.64.
But unfortunately 1.63(CI version) requires core::ffi instead of std::ffi.

https://doc.rust-lang.org/src/std/ffi/mod.rs.html#157

Which version should be support?

@nnmm
Copy link
Contributor

nnmm commented Oct 17, 2022

I don't fully understand – the compiler error sounds like 1.63 has core::ffi, but the release notes and core::ffi docs look like that module was introduced with 1.64? Maybe these types were available but experimental in 1.63.

Either way, I think it would be nice to support 1.63 if it's not too ugly. Maybe that requires using std::os::raw after all.

@Tacha-S
Copy link
Contributor Author

Tacha-S commented Oct 17, 2022

core::ffi was unstable before 1.64.0.

@Tacha-S Tacha-S marked this pull request as ready for review October 17, 2022 12:11
Copy link
Collaborator

@jhdcs jhdcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me! I only saw one spot where a comment's phrasing seemed a little odd.

That being said, a second pair of eyes would be useful, I think. Just in case I missed something.

out_seq.resize_to_at_least(in_seq.len());
out_seq.clone_from_slice(in_seq.as_slice());
true
// SAFETY: This is safe since a the point is guaranteed to be valid/initialized.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// SAFETY: This is safe since a the point is guaranteed to be valid/initialized.
// SAFETY: This is safe since the pointer is guaranteed to be valid/initialized.

@@ -42,7 +42,7 @@ pub trait RmwMessage: Clone + Debug + Default + Send + Sync + Message {
const TYPE_NAME: &'static str;

/// Get a pointer to the correct `rosidl_message_type_support_t` structure.
fn get_type_support() -> libc::uintptr_t;
fn get_type_support() -> usize;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here – could we make this pointer and the one in the Service trait a *const c_void?

Copy link
Collaborator

@jhdcs jhdcs left a 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!

@nnmm does everything look okay to you?

Copy link
Contributor

@nnmm nnmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you! :)

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.

4 participants