From cfbe68e46877cb0ff3f3da775b709c48513565c8 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Tue, 22 Nov 2022 15:20:53 +0800 Subject: [PATCH] sources: Silence C4013 warnings on Visual Studio The read(), close(), open(), lseek() functions are found in io.h on Visual Studio, which does not ship unistd.h, so include io.h on Windows if unistd.h is not found. C4013 (aka implicit declaration of ...) warnings can often ring alarm bells. --- catalog.c | 2 ++ nanoftp.c | 2 ++ nanohttp.c | 2 ++ xzlib.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/catalog.c b/catalog.c index 880f9100..bea1418d 100644 --- a/catalog.c +++ b/catalog.c @@ -23,6 +23,8 @@ #endif #ifdef HAVE_UNISTD_H #include +#elif defined (_WIN32) +#include #endif #ifdef HAVE_FCNTL_H #include diff --git a/nanoftp.c b/nanoftp.c index b52f9b64..2bfba853 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -23,6 +23,8 @@ #ifdef HAVE_UNISTD_H #include +#elif defined (_WIN32) +#include #endif #ifdef HAVE_SYS_SOCKET_H #include diff --git a/nanohttp.c b/nanohttp.c index d9619fdb..e014fe48 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -22,6 +22,8 @@ #ifdef HAVE_UNISTD_H #include +#elif defined (_WIN32) +#include #endif #ifdef HAVE_SYS_SOCKET_H #include diff --git a/xzlib.c b/xzlib.c index a07b3c88..33c27a26 100644 --- a/xzlib.c +++ b/xzlib.c @@ -22,6 +22,8 @@ #endif #ifdef HAVE_UNISTD_H #include +#elif defined (_WIN32) +#include #endif #ifdef LIBXML_ZLIB_ENABLED #include