]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
build: fix shunloadtest breakage
authorEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 19:06:27 +0000 (13:06 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 19:09:39 +0000 (13:09 -0600)
Commit 93ec384 was tested on mingw, but broke the build on Linux:

  CCLD     shunloadtest
shunloadtest.o: In function `main':
/home/eblake/libvirt/tests/shunloadtest.c:106: undefined reference to `virFilePrintf'
...
ssh.o: In function `main':
/home/eblake/libvirt/tests/ssh.c:43: undefined reference to `virFilePrintf'
/home/eblake/libvirt/tests/ssh.c:49: undefined reference to `virFilePrintf'

* tests/testutils.h (fprintf): Provide escape hatch.
* tests/shunloadtest.c: Use it.
* tests/ssh.c: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/shunloadtest.c
tests/ssh.c
tests/testutils.h

index 8190e97a75cd655b47d4e711ff6e2841ccf6b48a..499b1be5d4e08999d7cb39e3bea70eee0a15d120 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011, 2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,7 @@
 
 #include <config.h>
 
+#define NO_LIBVIRT /* This file intentionally does not link to libvirt */
 #include "testutils.h"
 
 #ifdef linux
index 76c60d31330a0ed5f935f276985729f70f097247..31bd390db46f68f4c76c7347ae8b4be4981ee1aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Red Hat, Inc.
+ * Copyright (C) 2011, 2013 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
 
 #include <stdio.h>
 #include "internal.h"
+#define NO_LIBVIRT /* This file intentionally does not link to libvirt */
 #include "testutils.h"
 
 #ifndef WIN32
index 73c5f884c1136899ff9d1062bc980bb571873fd7..27af5da69c26a2b524ab4bf814952327db79ca48 100644 (file)
 # define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */
 
 /* Work around lack of gnulib support for fprintf %z */
-# undef fprintf
-# define fprintf virFilePrintf
+# ifndef NO_LIBVIRT
+#  undef fprintf
+#  define fprintf virFilePrintf
+# endif
 
 extern char *progname;
 extern char *abs_srcdir;