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

lib/gvpr/CMakeLists.txt
lib/gvpr/compile.c
lib/gvpr/gvpr.c
lib/gvpr/gvprlib.vcxproj

index 58828a8ad3002c67b347a96c39a6981389cffd71..02c1c25f44b5d460d655993be993d839ddcaa331 100644 (file)
@@ -38,6 +38,10 @@ target_include_directories(gvpr SYSTEM PRIVATE
   ${GETOPT_INCLUDE_DIRS}
 )
 
+if(WIN32 AND NOT MINGW)
+  target_include_directories(gvpr PRIVATE ../../windows/include/unistd)
+endif()
+
 target_link_libraries(gvpr
   ast
   cgraph
index 795ac75b472c30d7cbf71a7733497d000d1250e1..73ff642dacb61c23a959812db6b5de5d5aaf7661 100644 (file)
@@ -16,9 +16,7 @@
 #include "config.h"
 #include <stdlib.h>
 #include <stdint.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <gvpr/compile.h>
 #include <assert.h>
 #include <cgraph/cgraph.h>
index 0720d6d2c5a86cf4535cb46c411f650cfb9d7ffd..1ae3e49e469f7d019e1a1e2a9da3cafd41ab729c 100644 (file)
  * Written by Emden Gansner
  */
 
-
-#include "config.h"
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#else
-#include <ast/compat_unistd.h>
-#endif
 #include "builddate.h"
 #include <gvpr/gprstate.h>
 #include <cgraph/agxbuf.h>
index 59539a8d873cc268bb20e856d8dfdb6c6bdca69a..c7fe25a3611aa9535c39c900e0542ae82550f250 100644 (file)
@@ -51,7 +51,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\dependencies\libraries\vcpkg\installed\x86-windows\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)windows\dependencies\libraries\vcpkg\installed\x86-windows\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>EXPORT_GVPR;_DEBUG;_LIB;GVDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -76,7 +76,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\dependencies\libraries\vcpkg\installed\x86-windows\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)windows\dependencies\libraries\vcpkg\installed\x86-windows\include;$(SolutionDir);$(SolutionDir)lib;$(SolutionDir)lib\cdt;$(SolutionDir)lib\cgraph;$(SolutionDir)lib\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>EXPORT_GVPR;_LIB;GVDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader />
       <WarningLevel>Level4</WarningLevel>