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

Generate cfg_condition on sys mode #646

Merged
merged 6 commits into from Oct 30, 2018

Conversation

Projects
None yet
3 participants
@ceyusa
Copy link
Contributor

ceyusa commented Oct 27, 2018

fixes #645

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Oct 27, 2018

Should probably also exist for types (e.g. GstEGLDisplay)

@ceyusa ceyusa force-pushed the ceyusa:features branch from 0dea41e to b24c9f4 Oct 27, 2018

let with_cfg_condition = functions.iter().find(|f| f.cfg_condition.is_some());
if let Some(info) = with_cfg_condition {
cfg_condition(w, &info.cfg_condition, commented, 1)?;
}

This comment has been minimized.

@EPashkin

EPashkin Oct 27, 2018

Member

Please use something like next here:

    let cfg_condition = configured_functions
        .iter()
        .filter_map(|f| f.cfg_condition.clone())
        .next();
    cfg_condition(w,  &cfg_condition, commented, 1)?;

This comment has been minimized.

@EPashkin

EPashkin Oct 27, 2018

Member

Maybe without clone

This comment has been minimized.

@ceyusa

ceyusa Oct 27, 2018

Author Contributor

without clone(): error[E0507]: cannot move out of borrowed content

This comment has been minimized.

@EPashkin

EPashkin Oct 27, 2018

Member

Hm. clone can't be removed, so better leave as is, sorry.

@ceyusa

This comment has been minimized.

Copy link
Contributor Author

ceyusa commented Oct 27, 2018

Should probably also exist for types (e.g. GstEGLDisplay)

Do structs and traits handle #[cfg(...)] ???

@ceyusa ceyusa force-pushed the ceyusa:features branch from b24c9f4 to 9d5c217 Oct 27, 2018

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Oct 27, 2018

Do structs and traits handle #[cfg(...)] ???

Yes, every item (functions, type declarations, code blocks, etc)

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Oct 27, 2018

Please update README.md in "The FFI mode .." section too
Thanks in advance.

@ceyusa ceyusa force-pushed the ceyusa:features branch from 9d5c217 to 53b398f Oct 29, 2018

README.md Outdated
cfg_condition = "feature = \"egl\""
```


This comment has been minimized.

@EPashkin

EPashkin Oct 30, 2018

Member

Please remove one empty line,

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Oct 30, 2018

@ceyusa Big thanks, please fix "update README.md with cfg_conditions for sys mode " and I will merge PR.

@ceyusa ceyusa force-pushed the ceyusa:features branch from 9d10771 to 3e9ec17 Oct 30, 2018

@ceyusa

This comment has been minimized.

Copy link
Contributor Author

ceyusa commented Oct 30, 2018

@ceyusa Big thanks, please fix "update README.md with cfg_conditions for sys mode " and I will merge PR.

Done 😃

@EPashkin EPashkin merged commit db3cb26 into gtk-rs:master Oct 30, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ceyusa ceyusa deleted the ceyusa:features branch Oct 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.