]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Bodge around the failing Coverity build in winshare.c.
authorSimon Tatham <anakin@pobox.com>
Tue, 23 Sep 2014 12:38:16 +0000 (12:38 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 23 Sep 2014 12:38:16 +0000 (12:38 +0000)
The winegcc hack I use for my Coverity builds is currently using a
version of wincrypt.h that's missing a couple of constants I use.
Ensure they're defined by hand, but (just in case I defined them
_wrong_) also provide a command-line define so I can do that only in
the case of Coverity builds.

[originally from svn r10234]

Buildscr.cv
windows/winshare.c

index 877865f3b7e738afa52114683465a7f31d18a653..0b4d1cbe6a0fa85d7241ae6317e02dae0b7f46fc 100644 (file)
@@ -25,7 +25,7 @@ enddelegate
 # Windows scanner for download).
 delegate covscan32wine
   in putty do tar xzvf cov-int.tar.gz
-  in putty/windows do cov-build --dir ../cov-int make -f Makefile.cyg CC=winegcc RC=wrc
+  in putty/windows do cov-build --dir ../cov-int make -f Makefile.cyg CC=winegcc RC=wrc XFLAGS=-DCOVERITY
   in putty do tar czvf cov-int.tar.gz cov-int
   return putty/cov-int.tar.gz
 enddelegate
index 89c1cc32591d57160c11e489ade7880a9433be06..a63325cb8abd24bd200797bfcc04061dac55e6d4 100644 (file)
 
 #include "winsecur.h"
 
+#ifdef COVERITY
+/*
+ * The hack I use to build for Coverity scanning, using winegcc and
+ * Makefile.cyg, didn't provide some defines in wincrypt.h last time I
+ * looked. Therefore, define them myself here, but enclosed in #ifdef
+ * COVERITY to ensure I don't make up random nonsense values for any
+ * real build.
+ */
+#ifndef CRYPTPROTECTMEMORY_BLOCK_SIZE
+#define CRYPTPROTECTMEMORY_BLOCK_SIZE 16
+#endif
+#ifndef CRYPTPROTECTMEMORY_CROSS_PROCESS
+#define CRYPTPROTECTMEMORY_CROSS_PROCESS 1
+#endif
+#endif
+
 #define CONNSHARE_PIPE_PREFIX "\\\\.\\pipe\\putty-connshare"
 #define CONNSHARE_MUTEX_PREFIX "Local\\putty-connshare-mutex"