Skip to content

Conversation

@joycepg
Copy link
Contributor

@joycepg joycepg commented Aug 13, 2015

C++ compilers require that C functions are declared inside an extern "C" { } scope. This stops the compiler mangling the names, which would cause link errors. This pull request adds those into the header file, conditionally if __cplusplus is defined. All C++ compilers do define this symbol when they are compiling C++.

C functions need to be included within extern "C" { } to avoid the compiler mangling the names.
__cplusplus is always defined by C++ compilers.
wrap header file in extern C scope
@review-ninja
Copy link

ReviewNinja

@rijnb
Copy link
Member

rijnb commented Aug 14, 2015

Good point.

rijnb added a commit that referenced this pull request Aug 14, 2015
extern C inside header file
@rijnb rijnb merged commit cea07d3 into mapcode-foundation:master Aug 14, 2015
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