]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix wincrypt.h inclusion on VS 6
authorBrad King <brad.king@kitware.com>
Wed, 11 Nov 2009 14:19:19 +0000 (09:19 -0500)
committerBrad King <brad.king@kitware.com>
Wed, 11 Nov 2009 14:19:19 +0000 (09:19 -0500)
The VS 6 version of wincrypt.h only works if _WIN32_WINNT >= 0x0400.
We block its inclusion through windows.h by defining NOCRYPT, and then
define _WIN32_WINNT and include it only when necessary.

SVN-Revision: 1633

libarchive/archive_windows.h

index 90116ed48ff98b42ea888d55f26dfa1058a6dae0..9ed6fc32c96ad392747e3bca2644ae72e8667831 100644 (file)
@@ -59,6 +59,7 @@
 #include <sys/stat.h>
 #include <process.h>
 #include <direct.h>
+#define NOCRYPT
 #include <windows.h>
 //#define      EFTYPE 7
 
@@ -277,6 +278,9 @@ typedef int pid_t;
 
 /* Message digest define */
 #if !defined(HAVE_OPENSSL_MD5_H) && !defined(HAVE_OPENSSL_SHA_H)
+# if defined(_MSC_VER) && _MSC_VER < 1300
+#  define _WIN32_WINNT 0x0400
+# endif
 #include <wincrypt.h>
 typedef struct {
        int             valid;