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

Use ISO __func__ instead of __FUNCTION__ #49

Merged
merged 2 commits into from
Jan 24, 2017

Conversation

andrelucas
Copy link
Contributor

gcc5 complains about FUNCTION.

gcc5 complains about __FUNCTION__.
@kozlovic
Copy link
Member

@andrelucas Thank you for your contribution. Unfortunately, I cannot merge this PR as-is: it would fail to compile on Windows (it compiles ok for me on Mac OS/X and Ubuntu).

However, what you could do is replace references of __func__ in this file with __NATS_FUNCTION__, add #include "natsp.h" and in src/include/n-unix.h add #define __NATS_FUNCTION__ __func__ and in src/include/n-win.h add #define __NATS_FUNCTION__ __FUNCTION__.

We could do all that directly in err.h, but doing the way I describe makes this available to other source files where we may need to have access to __func__/__FUNCTION__ in the future.

Let me know if you would like to make those changes, or I can do it if you prefer.

@andrelucas
Copy link
Contributor Author

I'll gladly do that, thanks for the crystal-clear explanation.

As recommended by @kozlovic, __FUNCTION__ is necessary to compile on
Windows. Follow his directions to work around this.
@kozlovic
Copy link
Member

@andrelucas All good! Thanks again for the contribution.

@kozlovic kozlovic merged commit e2fc2d2 into nats-io:master Jan 24, 2017
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.

2 participants