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

Changed to C linkage in netdb.h for fixing bug when using mixed C/C++ code (IDFGH-4027) #5900

Closed

Conversation

mathiasbredholt
Copy link
Contributor

I got an error when trying to compile a project with mixed C/C++ code. This fixes the linkage issues. The error message is:

error: conflicting declaration of 'int getnameinfo(const sockaddr*, socklen_t, char*, socklen_t, char*, socklen_t, int)' with 'C' linkage
 int getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
     ^~~~~~~~~~~

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2020

CLA assistant check
All committers have signed the CLA.

@mathiasbredholt mathiasbredholt changed the title Changed to C linkage for fixing bug when using mixed C/C++ code Changed to C linkage in netdb.h for fixing bug when using mixed C/C++ code Sep 23, 2020
@github-actions github-actions bot changed the title Changed to C linkage in netdb.h for fixing bug when using mixed C/C++ code Changed to C linkage in netdb.h for fixing bug when using mixed C/C++ code (IDFGH-4027) Sep 23, 2020
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution.

Copy link
Collaborator

@0xjakob 0xjakob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mathiasbredholt The change is a good catch! Thanks for providing this to us. I just have a tiny comment regarding the order of #ifdef and C++ guards.

components/lwip/port/esp32/include/netdb.h Outdated Show resolved Hide resolved
@Alvin1Zhang
Copy link
Collaborator

Thanks for your contribution again, changes have been merged with 8a10292

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.

None yet

4 participants