From 5ac243da2a2bb76afecacc47c84e0ba0e60bed14 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Sat, 4 Dec 2021 12:37:39 +0300 Subject: [PATCH] MSVC: Fix include files Error message: gost12sum.c(13,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory gost12sum.c(80,23): warning C4013: 'getopt' undefined; assuming extern returning int test_keyexpimp.c(7,10): fatal error C1083: Cannot open include file: 'arpa/inet.h': No such file or directory Signed-off-by: Vitaly Chikunov --- gost12sum.c | 12 ++++++++++++ test_keyexpimp.c | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gost12sum.c b/gost12sum.c index b44fe3b..e644a61 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -10,9 +10,21 @@ **********************************************************************/ #include #include +#ifdef _MSC_VER +#include "getopt.h" +# ifndef PATH_MAX +# define PATH_MAX _MAX_PATH +# endif +#include +typedef SSIZE_T ssize_t; +#else #include +#endif #include #include +#ifdef _WIN32 +# include +#endif #include #include "gosthash2012.h" #define BUF_SIZE 262144 diff --git a/test_keyexpimp.c b/test_keyexpimp.c index d7e0e09..31a42f7 100644 --- a/test_keyexpimp.c +++ b/test_keyexpimp.c @@ -4,7 +4,11 @@ * Contents licensed under the terms of the OpenSSL license * See https://www.openssl.org/source/license.html for details */ -#include +#ifdef _MSC_VER +# include +#else +# include +#endif #include #include #include -- 2.39.2