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

duplicate definition for srt.h #3066

Open
idc77 opened this issue Jan 3, 2025 · 2 comments
Open

duplicate definition for srt.h #3066

idc77 opened this issue Jan 3, 2025 · 2 comments

Comments

@idc77
Copy link

idc77 commented Jan 3, 2025

The following lib:
https://github.com/Haivision/srt
https://github.com/Haivision/srt/blob/v1.5.4/srtcore/srt.h
in version 1.5.4 , and bindgen 0.71.1

Generates

pub const IPPORT_RESERVED: u32 = 1024;
pub const IPPORT_RESERVED: _bindgen_ty_6 = 1024;

I'm very new to Rust and don't know what else to add.

@ojeda
Copy link
Contributor

ojeda commented Jan 8, 2025

Did you use --clang-macro-fallback, by chance?

If yes, then #3071 may be a duplicate of this one, but I filed it independently for the time being.

Thanks!

@pvdrz
Copy link
Contributor

pvdrz commented Jan 8, 2025

If this is the same IPPORT_RESERVED that's defined in both /usr/include/netinet/in.h and /usr/include/netdb.h. Then the issue is that it is defined twice in Rust as C enums and simple macro definitions are both translated as C constants.

A workaround for this is to add the enum item to the "blocklist":

bindgen --blocklist-item=IPPORT_RESERVED

In that way you should only get a single definition of IPPORT_RESERVED.

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

No branches or pull requests

3 participants