Skip to content

C emum types representation inconsistency #1528

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

Closed
cheblin opened this issue Mar 3, 2019 · 1 comment
Closed

C emum types representation inconsistency #1528

cheblin opened this issue Mar 3, 2019 · 1 comment

Comments

@cheblin
Copy link

cheblin commented Mar 3, 2019

for C enum

typedef enum
{
	PROCESS_CHANNEL_REQEST = 0x7fffffff,
	PROCESS_HOST_REQEST = 0x7fffffff - 1,
	PROCESS_RECEIVED_PACKS = 0x7fffffff - 2,
} PROCESS;

on MACOS rust-bindgen generate

pub const PROCESS_PROCESS_CHANNEL_REQEST: PROCESS = 2147483647;
pub const PROCESS_PROCESS_HOST_REQEST: PROCESS = 2147483646;
pub const PROCESS_PROCESS_RECEIVED_PACKS: PROCESS = 2147483645;

pub type PROCESS    = u32;

on Windows

pub const PROCESS_PROCESS_CHANNEL_REQEST: PROCESS = 2147483647;
pub const PROCESS_PROCESS_HOST_REQEST: PROCESS = 2147483646;
pub const PROCESS_PROCESS_RECEIVED_PACKS: PROCESS = 2147483645;

pub type PROCESS      = i32;
@emilio
Copy link
Contributor

emilio commented Mar 3, 2019

This is the type the underlying platform uses, so bindgen is doing the right thing.

This is a duplicate of #1244.

@emilio emilio closed this as completed Mar 3, 2019
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

2 participants