]> granicus.if.org Git - graphviz/commitdiff
move Windows unistd.h shim to its own directory
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 13 Apr 2022 06:41:44 +0000 (23:41 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Apr 2022 15:52:41 +0000 (08:52 -0700)
Graphviz contains two shims for platforms lacking unistd.h:

  1. windows/include/unistd.h
  2. lib/ast/compat_unistd.h

(1) is more comprehensive than (2), and we would like to replace (2) entirely
with (1). However, it is not currently possible to put (1) in the compiler’s
include path during the CMake build. Because it lives in the same directory as
the config.h used in the MS Build build, putting it in the compiler’s include
path also makes this config.h eligible for inclusion. This conflicts with the
CMake build system’s own generated config.h.

Moving this unistd.h to its own directory allows us to more selectively put it
in the include path when relevant. Though surprisingly this file seems unused
right now; even the adjacent config.h does not define `HAVE_UNISTD_H`,
indicating it should not be included.

With unistd.h available natively on every supported platform except Windows,
this change should allow removing unistd.h detection in future and
unconditionally including it when desired.

Gitlab: #2204

ci/clang_format.py
windows/include/unistd/unistd.h [moved from windows/include/unistd.h with 100% similarity]

index 004893c26a0adf8771ae4f7a5de9443c031637f6..9bc3a2728e7370ddecdd7dc99f465dd705a362a8 100644 (file)
@@ -885,7 +885,7 @@ EXCLUDE = (
   "windows/gvedit/USettings.h",
   "windows/gvedit/Umain.cpp",
   "windows/gvedit/Umain.h",
-  "windows/include/unistd.h",
+  "windows/include/unistd/unistd.h",
 )
 
 root = Path(__file__).parents[1]