netcdf-c/ncgen3
Dennis Heimbigner 8b0e1134b4 Ensure that netcdf_json.h does not interfere with ncjson.
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
2022-07-05 22:03:52 -06:00
..
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 More cleanup. 2022-01-24 15:01:23 -07:00
ncgen.l Fixed Clang -Wstrict-prototypes warnings 2022-03-01 23:21:24 -05:00
ncgen.y Fixed Clang -Wstrict-prototypes warnings 2022-03-01 23:21:24 -05:00
ncgenl.c Fixed Clang -Wstrict-prototypes warnings 2022-03-01 23:21:24 -05:00
ncgeny.c Fixed Clang -Wstrict-prototypes warnings 2022-03-01 23:21:24 -05:00
ncgeny.h
run_nc4_tests.sh Improve UTF8 Support On Windows 2022-02-08 20:53:30 -07:00
run_tests2.sh
run_tests.sh Ensure that netcdf_json.h does not interfere with ncjson. 2022-07-05 22:03:52 -06:00