From: Eric Blake Date: Mon, 11 Jul 2016 22:43:57 +0000 (-0600) Subject: build: virrandommock.c not needed on mingw X-Git-Tag: v2.1.0-rc1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc9cc507b8566b1f64c26020c30fbfb5d9ba7823;p=thirdparty%2Flibvirt.git build: virrandommock.c not needed on mingw We can't mock tests on Mingw, which lacks dlopen() and friends; follow the paradigms used in other mock files of conditionally compiling nothing when not building for Linux. Signed-off-by: Eric Blake --- diff --git a/tests/virrandommock.c b/tests/virrandommock.c index 1f2434e248..a69712a2cb 100644 --- a/tests/virrandommock.c +++ b/tests/virrandommock.c @@ -20,11 +20,13 @@ #include -#include "internal.h" -#include "virrandom.h" -#include "virmock.h" +#ifndef WIN32 -#define VIR_FROM_THIS VIR_FROM_NONE +# include "internal.h" +# include "virrandom.h" +# include "virmock.h" + +# define VIR_FROM_THIS VIR_FROM_NONE int virRandomBytes(unsigned char *buf, @@ -39,9 +41,9 @@ virRandomBytes(unsigned char *buf, } -#ifdef WITH_GNUTLS -# include -# include +# ifdef WITH_GNUTLS +# include +# include static int (*real_gnutls_dh_params_generate2)(gnutls_dh_params_t dparams, unsigned int bits); @@ -76,4 +78,7 @@ gnutls_dh_params_generate2(gnutls_dh_params_t dparams, return gnutls_dh_params_cpy(dparams, params_cache); } +# endif +#else /* WIN32 */ +/* Can't mock on WIN32 */ #endif