From ae94a21805c9632335b3cbb1514c6276c6f76ed1 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 13 Apr 2022 20:01:33 -0700 Subject: [PATCH] gvc: make #include of unistd.h unconditional Gitlab: #2204 --- lib/gvc.vcxproj | 4 ++-- lib/gvc/CMakeLists.txt | 6 ++++++ lib/gvc/gvdevice.c | 2 -- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/gvc.vcxproj b/lib/gvc.vcxproj index 4afcb79e6..dfa61a7e8 100644 --- a/lib/gvc.vcxproj +++ b/lib/gvc.vcxproj @@ -51,7 +51,7 @@ Disabled - $(SolutionDir)windows\include;$(SolutionDir)windows\dependencies\GTK2\include;$(SolutionDir)windows\dependencies\libraries\x86\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;$(SolutionDir)lib\pathplan;$(SolutionDir)lib\gvc;$(SolutionDir)lib\xdot;%(AdditionalIncludeDirectories) + $(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)windows\dependencies\GTK2\include;$(SolutionDir)windows\dependencies\libraries\x86\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;$(SolutionDir)lib\pathplan;$(SolutionDir)lib\gvc;$(SolutionDir)lib\xdot;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;GVDLL;GVC_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -83,7 +83,7 @@ awk -f $(SolutionDir)awk\colortbl.awk color_lib > common\colortbl.h - $(SolutionDir)windows\include;$(SolutionDir)windows\dependencies\GTK2\include;$(SolutionDir)windows\dependencies\libraries\x86\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;$(SolutionDir)lib\pathplan;$(SolutionDir)lib\gvc;$(SolutionDir)lib\xdot;%(AdditionalIncludeDirectories) + $(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)windows\dependencies\GTK2\include;$(SolutionDir)windows\dependencies\libraries\x86\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;$(SolutionDir)lib\pathplan;$(SolutionDir)lib\gvc;$(SolutionDir)lib\xdot;%(AdditionalIncludeDirectories) NDEBUG;_WINDOWS;_USRDLL;GVDLL;GVC_EXPORTS;%(PreprocessorDefinitions) Level4 diff --git a/lib/gvc/CMakeLists.txt b/lib/gvc/CMakeLists.txt index b1796d472..81bdeb195 100644 --- a/lib/gvc/CMakeLists.txt +++ b/lib/gvc/CMakeLists.txt @@ -46,6 +46,12 @@ target_include_directories(gvc ../.. ) +if(WIN32 AND NOT MINGW) + target_include_directories(gvc PRIVATE + ../../windows/include/unistd + ) +endif() + target_link_libraries(gvc PRIVATE $ $ diff --git a/lib/gvc/gvdevice.c b/lib/gvc/gvdevice.c index 626d47991..d84b649dd 100644 --- a/lib/gvc/gvdevice.c +++ b/lib/gvc/gvdevice.c @@ -21,9 +21,7 @@ #include #include #include -#ifdef HAVE_UNISTD_H #include -#endif #ifdef _WIN32 #include -- 2.40.0