Skip to content

Conversation

@prideout
Copy link
Contributor

@prideout prideout commented Feb 8, 2019

This fixes "extraneous closing brace" errors that would occur when attempting to include the same
file twice, caused by the extern C scope. This is also more consistent with the Sean Barrett libs.

This fixes "extraneous closing brace" errors that would occur when attempting to include the same
file twice, caused by the extern C scope. This is also more consistent with the Sean Barrett libs.
@jkuhlmann jkuhlmann self-assigned this Feb 9, 2019
@jkuhlmann
Copy link
Owner

Hm, wouldn’t this now lead to the implementation of the functions to not have C linkage if the implementation is included in a cpp source file?
Do we need one extern C for the declarations and one for the implementations to get this right?

@mosra
Copy link

mosra commented Feb 12, 2019

I think if the compiler first sees the declaration having C linkage, then the definition later will also have it, similarly to how it works with other attributes. So it should be enough to have just the declarations wrapped in extern "C".

@jkuhlmann
Copy link
Owner

Yepp, thanks, looks like it's fine this way. Having `extern "C"`` on the definition as well would also work, but is not required.

@jkuhlmann jkuhlmann merged commit 7fc6d3f into jkuhlmann:master Feb 13, 2019
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.

3 participants