From c0ff2947eacd045d26144ae34832f9b19585b53b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 16 Apr 2022 13:34:55 -0700 Subject: [PATCH] ast: make #includes of unistd.h unconditional Only the one in pathfind.c was actually having the intended effect, because the other two files were not #including config.h. Gitlab: #2204 --- lib/ast/CMakeLists.txt | 4 ++++ lib/ast/ast.vcxproj | 4 ++-- lib/ast/pathaccess.c | 4 ---- lib/ast/pathfind.c | 5 ----- lib/ast/pathpath.c | 4 ---- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/ast/CMakeLists.txt b/lib/ast/CMakeLists.txt index fd2f7a420..29b759119 100644 --- a/lib/ast/CMakeLists.txt +++ b/lib/ast/CMakeLists.txt @@ -24,3 +24,7 @@ add_library(ast STATIC target_include_directories(ast PRIVATE .. ) + +if(WIN32 AND NOT MINGW) + target_include_directories(ast PRIVATE ../../windows/include/unistd) +endif() diff --git a/lib/ast/ast.vcxproj b/lib/ast/ast.vcxproj index ac8117e76..5162248d9 100644 --- a/lib/ast/ast.vcxproj +++ b/lib/ast/ast.vcxproj @@ -51,7 +51,7 @@ Disabled - $(SolutionDir)windows\include;$(SolutionDir)lib + $(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib _DEBUG;_LIB;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -65,7 +65,7 @@ - $(SolutionDir)windows\include;$(SolutionDir)lib + $(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib NDEBUG;_LIB;%(PreprocessorDefinitions) Level4 diff --git a/lib/ast/pathaccess.c b/lib/ast/pathaccess.c index 5e1f64c52..a9f61147c 100644 --- a/lib/ast/pathaccess.c +++ b/lib/ast/pathaccess.c @@ -20,11 +20,7 @@ */ #include -#ifdef HAVE_UNISTD_H #include -#else -#include -#endif #include #include diff --git a/lib/ast/pathfind.c b/lib/ast/pathfind.c index da9cdcce5..1f1d10522 100644 --- a/lib/ast/pathfind.c +++ b/lib/ast/pathfind.c @@ -15,13 +15,8 @@ * include style search support */ -#include "config.h" #include -#ifdef HAVE_UNISTD_H #include -#else -#include -#endif #include #include diff --git a/lib/ast/pathpath.c b/lib/ast/pathpath.c index 205302a2e..22721f9d3 100644 --- a/lib/ast/pathpath.c +++ b/lib/ast/pathpath.c @@ -27,11 +27,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#else -#include -#endif static const char *getenv_path(void) { const char *path = getenv("PATH"); -- 2.40.0