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

[email protected] #31

Closed
wants to merge 1 commit into from
Closed

[email protected] #31

wants to merge 1 commit into from

Conversation

jeikabu
Copy link
Owner

@jeikabu jeikabu commented Feb 15, 2021

No description provided.

@neachdainn
Copy link
Collaborator

I will look this over soon.

Copy link
Collaborator

@neachdainn neachdainn left a comment

Choose a reason for hiding this comment

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

Sorry it took me so long to get this done.

The only concern I have is that size_t is now a u64 (technically a long long) instead of a usize, which will probably break things that aren't 64-bit. Previous versions did not have this issue but I don't see any changes to the bindgen

@janjaapbos
Copy link
Contributor

@neachdainn is your comment related to the following issue in bindgen, requiring the switch --size_t-is-usize?
See rust-lang/rust-bindgen#1671

@janjaapbos
Copy link
Contributor

janjaapbos commented Mar 31, 2021

It works for me when I add .size_t_is_usize(true) to build.rs. Also I need to hide the new NNG_AF_ABSTRACT socket.
With the diff below, I get a crate that can be used by nng-rs.

diff --git a/build.rs b/build.rs
index 917d177..22d5d86 100644
--- a/build.rs
+++ b/build.rs
@@ -116,6 +116,7 @@ fn build_bindgen() {
         .constified_enum("nng_pipe_ev")
         .use_core()
         .parse_callbacks(Box::new(BindgenCallbacks::default()))
+        .size_t_is_usize(true)
         // Layout tests are non-portable; 64-bit tests are "wrong" size on 32-bit and always fail.
         // Don't output tests if we're regenerating `src/bindings.rs` (shared by all platforms when bindgen not used)
         .layout_tests(!cfg!(feature = "source-update-bindings"));
@@ -169,6 +170,9 @@ impl bindgen::callbacks::ParseCallbacks for BindgenCallbacks {
         // We want to exclude it so it doesn't need to be included for `match` to be exhaustive.
         if original_variant_name == "NNG_PIPE_EV_NUM" {
             Some(bindgen::callbacks::EnumVariantCustomBehavior::Hide)
+        // NNG abstract sockets are only supported on Linux and non-portable
+        } else if original_variant_name == "NNG_AF_ABSTRACT" {
+            Some(bindgen::callbacks::EnumVariantCustomBehavior::Hide)
         } else {
             None
         }

@neachdainn neachdainn mentioned this pull request Mar 31, 2021
@jeikabu
Copy link
Owner Author

jeikabu commented Apr 8, 2021

Closing this in favor of #32

@jeikabu jeikabu closed this Apr 8, 2021
@neachdainn neachdainn deleted the feature/nng_v1.4.0 branch April 26, 2021 17:42
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.

3 participants