Browse Source

libarchive: Fix wincrypt.h inclusion on VS 6

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.
Brad King 16 years ago
parent
commit
d785cb0021
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Utilities/cmlibarchive/libarchive/archive_windows.h

+ 4 - 0
Utilities/cmlibarchive/libarchive/archive_windows.h

@@ -59,6 +59,7 @@
 #include <sys/stat.h>
 #include <process.h>
 #include <direct.h>
+#define NOCRYPT
 #include <windows.h>
 //#define   EFTYPE 7
 
@@ -296,6 +297,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;