MacOS requires <unistd.h> to also be handled via cmakedefine.
I guess on other platforms <unistd.h> is included automatically by some other header, but on Darwin/clang/libc++ it has to be specifically added as another header to cmakedefine.
Otherwise:
[ 35%] Building C object uulib/CMakeFiles/uulib.dir/uulib.c.o
/Users/Shared/source/pan/uulib/uulib.c:981:5: error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
close (fildes);
^
/Users/Shared/source/pan/uulib/uulib.c:992:7: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unlink (uugen_fnbuffer);
^
/Users/Shared/source/pan/uulib/uulib.c:1005:7: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unlink (uugen_fnbuffer);
^
/Users/Shared/source/pan/uulib/uulib.c:1015:7: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unlink (uugen_fnbuffer);
^
/Users/Shared/source/pan/uulib/uulib.c:1025:5: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unlink (uugen_fnbuffer);
^
/Users/Shared/source/pan/uulib/uulib.c:1033:7: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlink (thefile->binfile)) {
^
/Users/Shared/source/pan/uulib/uulib.c:1172:9: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlink (thefile->binfile)) {
^
/Users/Shared/source/pan/uulib/uulib.c:1198:9: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (unlink (iter->fname)) {
^
/Users/Shared/source/pan/uulib/uulib.c:1226:6: error: call to undeclared function 'unlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
unlink (fiter->data->sfname);
^