From: Matthew Fernandez Date: Thu, 14 Apr 2022 04:31:43 +0000 (-0700) Subject: sfio: make #include of unistd.h unconditional X-Git-Tag: 4.0.0~69^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b83524c0c6828c6f47e9a578ab95df5b87088cb7;p=graphviz sfio: make #include of unistd.h unconditional Gitlab: #2204 --- diff --git a/lib/sfio/CMakeLists.txt b/lib/sfio/CMakeLists.txt index 6f3a48845..3492342c3 100644 --- a/lib/sfio/CMakeLists.txt +++ b/lib/sfio/CMakeLists.txt @@ -42,3 +42,8 @@ target_include_directories(sfio PRIVATE .. ) +if(WIN32 AND NOT MINGW) + target_include_directories(sfio PRIVATE + ../../windows/include/unistd + ) +endif() diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index ed6f0ac5a..3100e5d37 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -59,9 +59,7 @@ extern "C" { #include -#ifdef HAVE_UNISTD_H #include -#endif #include #include @@ -579,19 +577,6 @@ extern "C" { #include #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 diff --git a/lib/sfio/sfio.vcxproj b/lib/sfio/sfio.vcxproj index 737f8e0aa..f7ad4ba90 100644 --- a/lib/sfio/sfio.vcxproj +++ b/lib/sfio/sfio.vcxproj @@ -51,7 +51,7 @@ Disabled - $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;%(AdditionalIncludeDirectories) + $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib;%(AdditionalIncludeDirectories) _DEBUG;_LIB;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -65,7 +65,7 @@ - $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)lib;%(AdditionalIncludeDirectories) + $(ProjectDir);$(SolutionDir)windows\include;$(SolutionDir)windows\include\unistd;$(SolutionDir)lib;%(AdditionalIncludeDirectories) NDEBUG;_LIB;%(PreprocessorDefinitions) Level4