Skip to content

Possibility to make bindgen only generate a single extern block? #1261

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
faern opened this issue Feb 22, 2018 · 1 comment
Closed

Possibility to make bindgen only generate a single extern block? #1261

faern opened this issue Feb 22, 2018 · 1 comment

Comments

@faern
Copy link

faern commented Feb 22, 2018

Input C/C++ Header

void foo();
void bar();

Bindgen Invocation

$ bindgen input.h

Actual Results

extern "C" {
    pub fn foo();
}
extern "C" {
    pub fn bar();
}

Expected Results

It becomes very verbose for no reason that is apparent to me. Personally I would prefer the following output:

extern "C" {
    pub fn foo();
    pub fn bar();
}

Maybe there is already a way to do this, but I could not find it. Nor did I find any issue touching the issue.

@emilio
Copy link
Contributor

emilio commented Feb 23, 2018

Closing as a dupe of #564.

TL;DR: Patches welcome as long as they're not a burden to maintain, but... I can't think of a nice way to do this that doesn't include adding yet another intermediate representation, or processing phase.

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