]> granicus.if.org Git - graphviz/commitdiff
ast: make #includes of unistd.h unconditional
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 16 Apr 2022 20:34:55 +0000 (13:34 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Apr 2022 15:52:41 +0000 (08:52 -0700)
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
lib/ast/ast.vcxproj
lib/ast/pathaccess.c
lib/ast/pathfind.c
lib/ast/pathpath.c

index fd2f7a4209f4c3a9b65e2f956088254c3090b09c..29b759119e04abb80b313b3ffe7fde699c76006e 100644 (file)
@@ -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()
index ac8117e76cf347ab861d725643d56b30ada2104d..5162248d9de9dc002b9aaefed327061dd329f733 100644 (file)
@@ -51,7 +51,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(SolutionDir)windows\include;$(SolutionDir)lib</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -65,7 +65,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
-      <AdditionalIncludeDirectories>$(SolutionDir)windows\include;$(SolutionDir)lib</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader />
       <WarningLevel>Level4</WarningLevel>
index 5e1f64c5263a9ba8576aa32188660bc0642bda8b..a9f61147c1ac4793e99281061dff6444bb66171c 100644 (file)
  */
 
 #include <ast/ast.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#else
-#include <ast/compat_unistd.h>
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
index da9cdcce50d726c41926bc3db4f4f6df1639539e..1f1d1052283f2bb3ea1e5db36cd4dfdd335cf2e0 100644 (file)
  * include style search support
  */
 
-#include "config.h"
 #include <ast/ast.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#else
-#include <ast/compat_unistd.h>
-#endif
 #include <stdio.h>
 #include <string.h>
 
index 205302a2effb01054fa7afaab117ed75d72e7e9f..22721f9d32ff542e28dae70089c71ec88d3b6336 100644 (file)
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#else
-#include <ast/compat_unistd.h>
-#endif
 
 static const char *getenv_path(void) {
   const char *path = getenv("PATH");