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

missing #if defined(__cplusplus) in netcdf_dispatch.h #1476

Closed
edhartnett opened this issue Aug 22, 2019 · 2 comments · Fixed by #1529
Closed

missing #if defined(__cplusplus) in netcdf_dispatch.h #1476

edhartnett opened this issue Aug 22, 2019 · 2 comments · Fixed by #1529

Comments

@edhartnett
Copy link
Contributor

In some of our header files (ex. hdf5dispatch.h) we have the if defined(__cplusplus) business around all our prototypes, like this:

#if defined(__cplusplus)
extern "C" {
#endif

   /* All function prototypes. */

#if defined(__cplusplus)
}
#endif

On other header files, like netcdf_dispatch.h, we don't have that.

Should we have that for all prototypes in all header files? I believe the answer is yes.

These are needed for C++ compilers to compile the netCDF C library, as described here: https://stackoverflow.com/questions/3789340/combining-c-and-c-how-does-ifdef-cplusplus-work

While this does not seem like a pressing need, there's no reason we should not be consistent and do this properly in all header files.

@edhartnett edhartnett changed the title inconsistent use of #if defined(__cplusplus) in header files missing #if defined(__cplusplus) in netcdf_dispatch.h Aug 22, 2019
@edhartnett
Copy link
Contributor Author

Actually this is just in netcdf_dispatch.h. I have a fix and it will be in my next PR.

@edhartnett
Copy link
Contributor Author

OK, this fix never made it, due to other issues with the PR. So I will submit a PR just for this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant