Skip to content

Conditional Compilation#20

Open
coriolinus wants to merge 4 commits intoscouten:mainfrom
coriolinus:18-conditional-compilation
Open

Conditional Compilation#20
coriolinus wants to merge 4 commits intoscouten:mainfrom
coriolinus:18-conditional-compilation

Conversation

@coriolinus
Copy link

Adds the ability to conditionally compile sync or async versions of the emitted functions, with arbitrary conditions.

Closes #18.

Rewriting argument parsing allows us to succinctly parse
three different arguments with the same overall shape.
We'll need that capability shortly.
When the `#[async_generic]` macro has a `sync_cfg(...)` argument,
the parameters to that argument are passed into a `#[cfg(...)]` block
for the sync version of the function.

When the `#[async_generic]` macro has an `async_cfg(...)` argument,
the parameters to that argument are passed into a `#[cfg(...)]` block
for the async version of that function.

Together, this gives users complete control over which versions
of the functions are compiled, when.
One test each (the passing tests) demonstrate that items which should
be retained are in fact retained.

One test each (the failing tests) demonstrate that items which should
be omitted are in fact omitted.
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 this pull request may close these issues.

Feature request: conditional compilation

1 participant