lib/common assumes unistd.h functions
MSVC reports the compilation warning:
utils.c
C:\GitLab-Runner\builds\graphviz\graphviz\lib\common\utils.c(361,13): warning C4013: 'access' undefined; assuming extern returning int [C:\GitLab-Runner\builds\graphviz\graphviz\build\lib\common\common_obj.vcxproj]
Backtracking what is going on here, it seems most uses of unistd.h functions in the code base have something like the following stanza:
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#else
#include <ast/compat_unistd.h>
#endif
This is not present in lib/common code because lib/common does not depend on lib/ast. Instead it just does nothing (yolo) if HAVE_UNISTD_H
prevents the inclusion of unistd.h.
So two relevant things to note:
- unistd.h “shimming” like this is still an ongoing concern, AFAIK. Windows remains a hold out, that refuses to ship unistd.h.
- lib/ast, (that I've heard variously referred to as “Abstract Software Toolkit” or “Advanced Software Technology” or “AT&T Software Technology”) is not the base of the dependency tree.
Should we move the unistd.h abstraction to cgraph or somewhere else? Should we try to purge platform-specific usage of such functions? Should we just shim unistd.h in windows/include/config.h that's hard coded anyway?