Fix Graphviz 13+ support: version detection and size_t switch
Potential fix for #2375.
Seems to work locally, but I do not have a ton of experience with C++ and autotools.
What about when dynamically loading the graphviz library at runtime?
What about when dynamically loading the graphviz library at runtime?
Do you mean trying to detect the graphviz version during runtime or if it's loaded without passing --with-graphviz?
If it's the former, there doesn't seem to be a great way to do that since graphviz's version header doesn't have a unique macro with the version number (just PACKAGE_VERSION, if I remember right). It would be hard to guarantee another package wouldn't use the same name and override it.
If it's the latter, I don't think it will build graphviz support unless you pass --enable-graphviz to the ./configure, so it seems unlikely this would be an issue.
But this is definitely not my forte (I'm mainly a bash shell scriptor), so it's very possible this might not be a proper fix (or the best way to fix it). I'm definitely open to any feedback!
I am not very familiar with this part of the codes as well but what I know is the official distributions for Linux and Windows are built with --with-graphviz=runtime (https://github.com/MediaArea/MediaInfoLib/commit/1eecc6fdd6730955035385f7a2da7e6dde585a55) which it will load Graphviz during runtime when using graph mode if the .so or .dll are found else it will safely fail with indication that graph plugin is not found. So I wonder in this case how are the versions handled.
Thank you for working on it. As @cjee21 indicated, there is still a problem with the dynamic load, there is a need to detect the version during dynamic loading and bind the right interface (old or new) accordingly. If you can do that it would be great, else we let open this ticket until we have time for doing it.
Looks like one way to determine the version during dynamic loading (for Windows at least, don't know about Linux version) is to check if there is xml_escape function exported in gvc.dll. It is no longer exported starting version 13 (https://gitlab.com/graphviz/graphviz/-/merge_requests/4278/diffs?commit_id=f7a9642928d1543b4d0e4bbf3cba7c290dcf43c8#add2a648a46f612f78e218ebe0d988ca7ee2e36d_0_1).