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

Macros use local types #16

Open
TimDiekmann opened this issue Feb 16, 2018 · 1 comment
Open

Macros use local types #16

TimDiekmann opened this issue Feb 16, 2018 · 1 comment

Comments

@TimDiekmann
Copy link

TimDiekmann commented Feb 16, 2018

The macros like vk_make_version! use local types:

macro_rules! vk_make_version {
    ($major: expr, $minor: expr, $patch: expr) => ((($major as uint32_t) << 22) | (($minor as uint32_t) << 12) | $patch as uint32_t)
}

Expected behavior:

#[macro_export]
macro_rules! vk_make_version {
    ($major: expr, $minor: expr, $patch: expr) => ((($major as $crate::uint32_t) << 22) | (($minor as $crate::uint32_t) << 12) | $patch as $crate::uint32_t)
}
@TimDiekmann TimDiekmann changed the title Macro uses local types Macros use local types Feb 16, 2018
@TimDiekmann TimDiekmann mentioned this issue Feb 16, 2018
@Osspial
Copy link
Owner

Osspial commented Mar 11, 2018

This fix works if the generated bindings are in the crate root, but I don't think it would work in cases where it's not - say, if it's included as a submodule. However, since they're using uint32_t as the number type, I'd say it would be fine to convert them into straight u32s instead.

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 a pull request may close this issue.

2 participants