aboutsummaryrefslogtreecommitdiff
path: root/gost12sum.c
diff options
context:
space:
mode:
authorVitaly Chikunov <vt@altlinux.org>2021-12-04 12:37:39 +0300
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>2021-12-11 19:45:14 +0300
commit5ac243da2a2bb76afecacc47c84e0ba0e60bed14 (patch)
tree4ccea08a11d2f567c6e303f3d6f4b7cfa6ba315e /gost12sum.c
parent141dc82447a18bc8660032216b9b42758c80d335 (diff)
downloadgost-engine-5ac243da2a2bb76afecacc47c84e0ba0e60bed14.zip
gost-engine-5ac243da2a2bb76afecacc47c84e0ba0e60bed14.tar.gz
gost-engine-5ac243da2a2bb76afecacc47c84e0ba0e60bed14.tar.bz2
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 <vt@altlinux.org>
Diffstat (limited to 'gost12sum.c')
-rw-r--r--gost12sum.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gost12sum.c b/gost12sum.c
index b44fe3b..e644a61 100644
--- a/gost12sum.c
+++ b/gost12sum.c
@@ -10,9 +10,21 @@
**********************************************************************/
#include <stdio.h>
#include <stdlib.h>
+#ifdef _MSC_VER
+#include "getopt.h"
+# ifndef PATH_MAX
+# define PATH_MAX _MAX_PATH
+# endif
+#include <BaseTsd.h>
+typedef SSIZE_T ssize_t;
+#else
#include <unistd.h>
+#endif
#include <limits.h>
#include <fcntl.h>
+#ifdef _WIN32
+# include <io.h>
+#endif
#include <string.h>
#include "gosthash2012.h"
#define BUF_SIZE 262144