I am trying to update an older application which worked fine in 2023 using GraphViz as a library.
The function gvPluginList, declared in gvc.h, used to take four arguments, but now the last one was dropped at some point (type const char *)..
I would like to wrap the call to gvPluginList in #if..#endif macros and check the version number when this no longer worked as before, but don’t know how to find this without looking at all of the source code between version 2.4x and currently 13.1.2.
Duh… I finally thought to look at CHANGELOG.md, and there it is (version 9.0.0).
(EDIT: It would be nice if the version was exposed as a number – better yet: broken down into major, minor, and build elements – and not only as a string.)
(EDIT #2: Since there is apparently no way to get the C preprocessor to convert a string into a number, I found some other macros which had been removed in the upgrade to version 9.0.0. Now I am able to check for the definition of the macro DTTREEMATCH which was defined before, i.e.:
Hoping that there won’t be too many other problems in this regard.
(EDIT #3: There was a change of parameter type for the function gvRenderData (the last, which used to take an unsigned int* and as of version 13.0,0 takes a size_t*). Here is a switch you can use for that:
No, you’re completely correct. I just hadn’t looked at that file for some time. I agree that there isn’t really a good way to do this conditional coding without the version information exposed as integers.