]> granicus.if.org Git - graphviz/commitdiff
common: make #include of unistd.h unconditional
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 16 Apr 2022 00:05:38 +0000 (17:05 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Apr 2022 15:52:41 +0000 (08:52 -0700)
Gitlab: #2204

lib/common/CMakeLists.txt
lib/common/utils.c

index 3121d40f1c956118ed03f073f7c1f7fe6d501d84..3ce347d6b98b34c1ac21388dd255b9e9ce35e911 100644 (file)
@@ -133,6 +133,10 @@ if(WIN32)
                              PRIVATE ${WINDOWS_DEPENDENCY_DIR}/include)
 endif()
 
+if(WIN32 AND NOT MINGW)
+  target_include_directories(common_obj PRIVATE ../../windows/include/unistd)
+endif()
+
 # From https://gitlab.com/graphviz/graphviz/-/issues/1613 @mdwies 20093010
 if(APPLE)
   target_compile_options(common_obj PRIVATE "-fno-common")
index 85870bbfa3c2b7fdc9b54a9c9779ae05ecf7e549..5544260c23dcbd7da0b8faa3f5d90a0dbf441209 100644 (file)
 #include <cgraph/strcasecmp.h>
 #include <stddef.h>
 #include <stdbool.h>
-
-#ifdef _WIN32
-#define R_OK 4
-#endif
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif // HAVE_UNISTD_H
+#include <unistd.h>
 
 #include <ctype.h>