From 5757372443a58d0bfdf0f5c0130a6d77fed81427 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 15 Apr 2022 17:05:38 -0700 Subject: [PATCH] common: make #include of unistd.h unconditional Gitlab: #2204 --- lib/common/CMakeLists.txt | 4 ++++ lib/common/utils.c | 9 +-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt index 3121d40f1..3ce347d6b 100644 --- a/lib/common/CMakeLists.txt +++ b/lib/common/CMakeLists.txt @@ -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") diff --git a/lib/common/utils.c b/lib/common/utils.c index 85870bbfa..5544260c2 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -18,14 +18,7 @@ #include #include #include - -#ifdef _WIN32 -#define R_OK 4 -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif // HAVE_UNISTD_H +#include #include -- 2.40.0