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

#[cfg(before_api)] and #[cfg(since_api)] #344

Merged
merged 2 commits into from
Jul 16, 2023
Merged

#[cfg(before_api)] and #[cfg(since_api)] #344

merged 2 commits into from
Jul 16, 2023

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Jul 16, 2023

Addresses the fact that we almost always want to know if an API is larger than a given version, not equal to it.

Also adds to cfgs that are considerably nicer to use:

#[cfg(gdextension_api = "4.0")]       ->  #[cfg(before_api = "4.1")]
#[cfg(not(gdextension_api = "4.0"))]  ->  #[cfg(since_api = "4.1")]

I preserved the old macros as gdextension_minor_api and gdextension_exact_api for now, but if they find no use, we may remove them later.

Works on ranges rather than fixed versions. Most of the time, features are present _starting_ at a given version, not _only_ in that version.

Also, the wording makes it much more readable than `#[cfg(not(gdextension_api = "4.0"))]`.
@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools labels Jul 16, 2023
@Bromeon Bromeon enabled auto-merge July 16, 2023 09:20
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-344

@Bromeon Bromeon added this pull request to the merge queue Jul 16, 2023
Merged via the queue into master with commit fd1d50f Jul 16, 2023
13 checks passed
@Bromeon Bromeon deleted the qol/api-version branch July 16, 2023 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: tooling CI, automation, tools quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants