From 5e9d6b3a46c375e86e8b3be00d5eaef97dcf92fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 22 Jul 2020 17:31:33 +0100 Subject: [PATCH] tests: don't mock the time() function on mingw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mingw header define time() as a static inline function and this causes a duplicate definition build failure. Since we're not using the LD_PRELOAD at all on Mingw, we ideally wouldn't compile any of the mock libraries. Rather than change the build system now though, this just stubs out the offending function. Reviewed-by: Laine Stump Signed-off-by: Daniel P. Berrangé --- tests/virnetdaemonmock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/virnetdaemonmock.c b/tests/virnetdaemonmock.c index 3b92fff8c9..c523da0791 100644 --- a/tests/virnetdaemonmock.c +++ b/tests/virnetdaemonmock.c @@ -23,6 +23,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE +#ifndef WIN32 time_t time(time_t *t) { const time_t ret = 1234567890; @@ -30,3 +31,4 @@ time_t time(time_t *t) *t = ret; return ret; } +#endif