]> granicus.if.org Git - graphviz/commitdiff
sfio: make #include of unistd.h unconditional
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 14 Apr 2022 04:31:43 +0000 (21:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Apr 2022 15:52:41 +0000 (08:52 -0700)
Gitlab: #2204

lib/sfio/CMakeLists.txt
lib/sfio/sfhdr.h
lib/sfio/sfio.vcxproj

index 6f3a48845147c5ed76f74efc24832f0922138013..3492342c3c75f2eb81e8825e1a05ca337521df36 100644 (file)
@@ -42,3 +42,8 @@ target_include_directories(sfio PRIVATE
   ..
 )
 
+if(WIN32 AND NOT MINGW)
+  target_include_directories(sfio PRIVATE
+    ../../windows/include/unistd
+  )
+endif()
index ed6f0ac5a652054676cec997fbca4fab25ef7604..3100e5d37614c7e2184f24027dc9dbddd00f69fd 100644 (file)
@@ -59,9 +59,7 @@ extern "C" {
 
 #include       <fcntl.h>
 
-#ifdef HAVE_UNISTD_H
 #include       <unistd.h>
-#endif
 
 #include       <errno.h>
 #include       <ctype.h>
@@ -579,19 +577,6 @@ extern "C" {
 #include <io.h>
 #define SF_ERROR       0000400 /* an error happened                    */
 #else
-#ifndef HAVE_UNISTD_H
-    extern int close(int);
-    extern ssize_t read(int, void *, size_t);
-    extern ssize_t write(int, const void *, size_t);
-    extern off_t lseek(int, off_t, int);
-    extern int dup(int);
-    extern int isatty(int);
-    extern int wait(int *);
-    extern int pipe(int *);
-    extern uint sleep(uint);
-    extern int execl(const char *, const char *, ...);
-
-#endif /*HAVE_UNISTD_H*/
 #endif /* _WIN32 */
 
 #ifdef HAVE_SYS_STAT_H
index 737f8e0aacf0e3a192da832944375c396f1ff57a..f7ad4ba90957917b75ffefe79e8be4924dab042a 100644 (file)
@@ -51,7 +51,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib;%(AdditionalIncludeDirectories)</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>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PrecompiledHeader />
       <WarningLevel>Level4</WarningLevel>