]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: don't mock the time() function on mingw
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 22 Jul 2020 16:31:33 +0000 (17:31 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 23 Jul 2020 13:58:16 +0000 (14:58 +0100)
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 <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
tests/virnetdaemonmock.c

index 3b92fff8c972c2d07bcf9eba7853663758dc2c9e..c523da0791cc44103a6efd387f5ed4659845b3a1 100644 (file)
@@ -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