mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
8b0e1134b4
re: Issue https://github.com/Unidata/netcdf-c/issues/2419 There are effectively two json subsystems in netcdf-c. 1. ncjson.[ch] in libnetcdf 2. netcdf_json.h for use by plugins so they can be built without need for libnetcdf. The netcdf_json.h file is constructed from the concatenation of ncjson.h plus ncjson.c. It turned out that in doing this, I was leaving some symbols externally visible so that if, for some reason, a plugin was built and needed libnetcdf, then symbol conflicts arose. The solution is to prefix the declarations in ncjson.[ch] with a macro (OPTSTATIC) that can be resolved to either nothing or to "static". Then in netcdf_json.h, it resolves to "static" and prevents the symbol conflicts. Note that netcdf_json.h is constructed once in netcdf-c/include/Makefile.am with the rule named "makepluginjson". This means that it is included in the distribution. However, this also means that if ncjson.[ch] is changed, then it is necessary to invoke makepluginjson explicitly to rebuild netcdf_json.h |
||
---|---|---|
.. | ||
bigf1.cdl | ||
bigf2.cdl | ||
bigf3.cdl | ||
bigr1.cdl | ||
bigr2.cdl | ||
bigr3.cdl | ||
c0.cdl | ||
CMakeLists.txt | ||
depend | ||
escapes.c | ||
generic.h | ||
genlib.c | ||
genlib.h | ||
getfill.c | ||
init.c | ||
lfs-tests | ||
load.c | ||
main_cpp.cpp | ||
main.c | ||
Makefile.am | ||
ncgen3.1 | ||
ncgen.h | ||
ncgen.l | ||
ncgen.y | ||
ncgenl.c | ||
ncgeny.c | ||
ncgeny.h | ||
run_nc4_tests.sh | ||
run_tests2.sh | ||
run_tests.sh |