]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
MSVC: Fix include files
authorVitaly Chikunov <vt@altlinux.org>
Sat, 4 Dec 2021 09:37:39 +0000 (12:37 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Dec 2021 16:45:14 +0000 (19:45 +0300)
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>
gost12sum.c
test_keyexpimp.c

index b44fe3bdb601da32551796e72f7486a26a77d94c..e644a613b1285dda78f896eb4e220e8a0b287da7 100644 (file)
  **********************************************************************/
 #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
index d7e0e09e241478e0b5d957c097ce49e74a020377..31a42f7260c041faabe7bee50f7ea6904fc76686 100644 (file)
@@ -4,7 +4,11 @@
  * Contents licensed under the terms of the OpenSSL license
  * See https://www.openssl.org/source/license.html for details
  */
-#include <arpa/inet.h>
+#ifdef _MSC_VER
+# include <Winsock2.h>
+#else
+# include <arpa/inet.h>
+#endif
 #include <string.h>
 #include <stdio.h>
 #include <string.h>