]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: use #pragma once in headers
authorJonathon Jongsma <jjongsma@redhat.com>
Tue, 18 Jun 2019 16:13:14 +0000 (11:13 -0500)
committerJán Tomko <jtomko@redhat.com>
Wed, 19 Jun 2019 15:12:34 +0000 (17:12 +0200)
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
12 files changed:
tests/qemumonitortestutils.h
tests/qemusecuritytest.h
tests/testutils.h
tests/testutilshostcpus.h
tests/testutilslxc.h
tests/testutilsqemu.h
tests/testutilsqemuschema.h
tests/testutilsxen.h
tests/virfilewrapper.h
tests/virhashdata.h
tests/virmock.h
tests/virnettlshelpers.h

index 3e93f9551aca35e8697bda52c8efea725ec0da2d..75ea63382deca6230ca7dba42a1e4a779840a23f 100644 (file)
  *
  */
 
-#ifndef LIBVIRT_QEMUMONITORTESTUTILS_H
-# define LIBVIRT_QEMUMONITORTESTUTILS_H
+#pragma once
 
-# include "domain_conf.h"
-# include "qemu/qemu_conf.h"
-# include "qemu/qemu_monitor.h"
-# include "qemu/qemu_agent.h"
-# include "virautoclean.h"
+#include "domain_conf.h"
+#include "qemu/qemu_conf.h"
+#include "qemu/qemu_monitor.h"
+#include "qemu/qemu_agent.h"
+#include "virautoclean.h"
 
 typedef struct _qemuMonitorTest qemuMonitorTest;
 typedef qemuMonitorTest *qemuMonitorTestPtr;
@@ -74,9 +73,9 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test,
                                  bool apostrophe,
                                  const char *response);
 
-# define qemuMonitorTestNewSimple(xmlopt) \
+#define qemuMonitorTestNewSimple(xmlopt) \
     qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, NULL)
-# define qemuMonitorTestNewSchema(xmlopt, schema) \
+#define qemuMonitorTestNewSchema(xmlopt, schema) \
     qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema)
 
 qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt,
@@ -103,5 +102,3 @@ qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test);
 virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test);
 
 VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorTest, qemuMonitorTestFree);
-
-#endif /* LIBVIRT_QEMUMONITORTESTUTILS_H */
index a26014b5dce1f7c68385ee11fdff7311298bc558..f166eac3aca942cd0e9d2295fea97bc5e8367392 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_QEMUSECURITYTEST_H
-# define LIBVIRT_QEMUSECURITYTEST_H
+#pragma once
 
-# define ENVVAR "LIBVIRT_QEMU_SECURITY_TEST"
+#define ENVVAR "LIBVIRT_QEMU_SECURITY_TEST"
 
 extern int checkPaths(void);
-
-#endif /* LIBVIRT_QEMUSECURITYTEST_H */
index d0a259e2d4cb7e21ca08fc7bc98656be3bd12129..8c12fd7c12bf9ad6ad7343dbec02982aa74de935 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILS_H
-# define LIBVIRT_TESTUTILS_H
+#pragma once
 
-# include "viralloc.h"
-# include "virfile.h"
-# include "virstring.h"
-# include "virjson.h"
-# include "capabilities.h"
-# include "domain_conf.h"
+#include "viralloc.h"
+#include "virfile.h"
+#include "virstring.h"
+#include "virjson.h"
+#include "capabilities.h"
+#include "domain_conf.h"
 
-# define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
-# define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */
+#define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */
+#define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */
 
 /* Work around lack of gnulib support for fprintf %z */
-# ifndef NO_LIBVIRT
-#  undef fprintf
-#  define fprintf virFilePrintf
-# endif
+#ifndef NO_LIBVIRT
+# undef fprintf
+# define fprintf virFilePrintf
+#endif
 
 extern char *progname;
 
 /* Makefile.am provides these two definitions */
-# if !defined(abs_srcdir) || !defined(abs_builddir)
-#  error Fix Makefile.am
-# endif
+#if !defined(abs_srcdir) || !defined(abs_builddir)
+# error Fix Makefile.am
+#endif
 
 bool virTestOOMActive(void);
 
@@ -88,13 +87,13 @@ unsigned int virTestGetVerbose(void);
 unsigned int virTestGetExpensive(void);
 unsigned int virTestGetRegenerate(void);
 
-# define VIR_TEST_DEBUG(...) \
+#define VIR_TEST_DEBUG(...) \
     do { \
         if (virTestGetDebug()) \
             fprintf(stderr, __VA_ARGS__); \
     } while (0)
 
-# define VIR_TEST_VERBOSE(...) \
+#define VIR_TEST_VERBOSE(...) \
     do { \
         if (virTestGetVerbose()) \
             fprintf(stderr, __VA_ARGS__); \
@@ -113,12 +112,12 @@ int virTestMain(int argc,
                 ...);
 
 /* Setup, then call func() */
-# define VIR_TEST_MAIN(func) \
+#define VIR_TEST_MAIN(func) \
     int main(int argc, char **argv) { \
         return virTestMain(argc, argv, func, NULL); \
     }
 
-# define VIR_TEST_PRELOAD(lib) \
+#define VIR_TEST_PRELOAD(lib) \
     do { \
         const char *preload = getenv("LD_PRELOAD"); \
         if (preload == NULL || strstr(preload, lib) == NULL) { \
@@ -138,7 +137,7 @@ int virTestMain(int argc,
         } \
     } while (0)
 
-# define VIR_TEST_MAIN_PRELOAD(func, ...) \
+#define VIR_TEST_MAIN_PRELOAD(func, ...) \
     int main(int argc, char **argv) { \
         return virTestMain(argc, argv, func, __VA_ARGS__, NULL); \
     }
@@ -163,5 +162,3 @@ int testCompareDomXML2XMLFiles(virCapsPtr caps,
                                bool live,
                                unsigned int parseFlags,
                                testCompareDomXML2XMLResult expectResult);
-
-#endif /* LIBVIRT_TESTUTILS_H */
index 32929a095354b863014d96006ceef619d47ab566..a8c34cfc4a93d6e792e3e6b4e2222b78efe5a7e2 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILSHOSTCPUS_H
-# define LIBVIRT_TESTUTILSHOSTCPUS_H
+#pragma once
 
-# include "conf/cpu_conf.h"
-# include "internal.h"
-# include "util/virarch.h"
+#include "conf/cpu_conf.h"
+#include "internal.h"
+#include "util/virarch.h"
 
 static virCPUFeatureDef cpuDefaultFeatures[] = {
     { (char *) "ds",        -1 },
@@ -165,5 +164,3 @@ testUtilsHostCpusGetDefForArch(virArch arch)
 
     return NULL;
 }
-
-#endif /* LIBVIRT_TESTUTILSHOSTCPUS_H */
index 16f1986ecaa821b0bb434fb19b937d48ddce79ca..6339f8873400059fda80b2b69ecc23eaa6252efd 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILSLXC_H
-# define LIBVIRT_TESTUTILSLXC_H
+#pragma once
 
-# include "capabilities.h"
+#include "capabilities.h"
 
-# define FAKEDEVDIR0 "/fakedevdir0/bla/fasl"
-# define FAKEDEVDIR1 "/fakedevdir1/bla/fasl"
+#define FAKEDEVDIR0 "/fakedevdir0/bla/fasl"
+#define FAKEDEVDIR1 "/fakedevdir1/bla/fasl"
 
 virCapsPtr testLXCCapsInit(void);
-
-#endif /* LIBVIRT_TESTUTILSLXC_H */
index 25dedb5edd272f07401d636df4d719335a2f7ed3..0632141d68fb7f07ec79266b9090a7e5c06ee464 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILSQEMU_H
-# define LIBVIRT_TESTUTILSQEMU_H
+#pragma once
 
-# ifdef WITH_QEMU
+#ifdef WITH_QEMU
 
-#  include "capabilities.h"
-#  include "virfilecache.h"
-#  include "domain_conf.h"
-#  include "qemu/qemu_capabilities.h"
-#  include "qemu/qemu_conf.h"
+# include "capabilities.h"
+# include "virfilecache.h"
+# include "domain_conf.h"
+# include "qemu/qemu_capabilities.h"
+# include "qemu/qemu_conf.h"
 
-#  define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata"
+# define TEST_QEMU_CAPS_PATH abs_srcdir "/qemucapabilitiesdata"
 
 enum {
     GIC_NONE = 0,
@@ -107,6 +106,4 @@ int testQemuInfoSetArgs(struct testQemuInfo *info,
                         virHashTablePtr capslatest, ...);
 void testQemuInfoClear(struct testQemuInfo *info);
 
-# endif
-
-#endif /* LIBVIRT_TESTUTILSQEMU_H */
+#endif
index 73984e994642f188937b34116db89b39f87335e2..de9da7cb975f57ff4a82b93eda1e42c00f881fdd 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILSQEMUSCHEMA_H
-# define LIBVIRT_TESTUTILSQEMUSCHEMA_H
+#pragma once
 
-# include "virhash.h"
-# include "virjson.h"
-# include "virbuffer.h"
+#include "virhash.h"
+#include "virjson.h"
+#include "virbuffer.h"
 
 int
 testQEMUSchemaValidate(virJSONValuePtr obj,
@@ -34,5 +33,3 @@ testQEMUSchemaGetLatest(void);
 
 virHashTablePtr
 testQEMUSchemaLoad(void);
-
-#endif /* LIBVIRT_TESTUTILSQEMUSCHEMA_H */
index 9164a59507069ebb5f881869557834140ac448ae..95dadb04c4000816d0ef52ed68b9db66926cef3f 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_TESTUTILSXEN_H
-# define LIBVIRT_TESTUTILSXEN_H
+#pragma once
 
-# include "capabilities.h"
-# ifdef WITH_LIBXL
-#  include "libxl/libxl_capabilities.h"
-# endif
+#include "capabilities.h"
+#ifdef WITH_LIBXL
+# include "libxl/libxl_capabilities.h"
+#endif
 
 virCapsPtr testXLInitCaps(void);
-
-#endif /* LIBVIRT_TESTUTILSXEN_H */
index 80fd6244adfe9f605e94067471a88dc85c75ee89..a19c771d3b11a198f7839725d636b40854495c61 100644 (file)
@@ -16,8 +16,7 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_VIRFILEWRAPPER_H
-# define LIBVIRT_VIRFILEWRAPPER_H
+#pragma once
 
 void
 virFileWrapperAddPrefix(const char *prefix,
@@ -28,5 +27,3 @@ virFileWrapperRemovePrefix(const char *prefix);
 
 void
 virFileWrapperClearPrefixes(void);
-
-#endif /* LIBVIRT_VIRFILEWRAPPER_H */
index 309519962d560629e6ebb444f2df3d411eaa8cfb..1b457f2857532a2657a46482e8784f1e6fb364c9 100644 (file)
@@ -14,8 +14,7 @@
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_VIRHASHDATA_H
-# define LIBVIRT_VIRHASHDATA_H
+#pragma once
 
 const char *uuids[] = {
 /* [  2] */ "a9b02f96-e430-4f7c-a7ff-a647d080447a",
@@ -283,5 +282,3 @@ const char *uuids_new[] = {
     "5920cc9d-62a3-4772-9e73-eb97f0bc483c",
     "53c215dd-bdba-4fdc-887a-86ab6f860df4",
 };
-
-#endif /* LIBVIRT_VIRHASHDATA_H */
index 46631433c7a8893639b7c9e009ffe77c3136aed7..74bb0d5b1531e6006a3f4e89a9fd2e1e85ecae1f 100644 (file)
  *
  */
 
-#ifndef LIBVIRT_VIRMOCK_H
-# define LIBVIRT_VIRMOCK_H
-
-# if HAVE_DLFCN_H
-#  include <dlfcn.h>
-# endif
-
-# include "internal.h"
-
-# define VIR_MOCK_COUNT_ARGS(...) VIR_MOCK_ARG21(__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
-# define VIR_MOCK_ARG21(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, ...) _21
-# define VIR_MOCK_ARG_PASTE(a, b, ...) a##b(__VA_ARGS__)
-
-# define VIR_MOCK_ARGNAME(a, b) b
-# define VIR_MOCK_ARGTYPE(a, b) a
-# define VIR_MOCK_ARGTYPENAME(a, b) a b
-# define VIR_MOCK_ARGTYPENAME_UNUSED(a, b) a b ATTRIBUTE_UNUSED
-
-# define VIR_MOCK_GET_ARG2(z, a, b) z(a, b)
-# define VIR_MOCK_GET_ARG3(z, a, b, c) z(a, b)
-# define VIR_MOCK_GET_ARG4(z, a, b, c, d) z(a, b),  z(c, d)
-# define VIR_MOCK_GET_ARG5(z, a, b, c, d, e) z(a, b),  z(c, d)
-# define VIR_MOCK_GET_ARG6(z, a, b, c, d, e, f) z(a, b),  z(c, d), z(e, f)
-# define VIR_MOCK_GET_ARG7(z, a, b, c, d, e, f, g) z(a, b),  z(c, d), z(e, f)
-# define VIR_MOCK_GET_ARG8(z, a, b, c, d, e, f, g, h) z(a, b),  z(c, d), z(e, f), z(g, h)
-# define VIR_MOCK_GET_ARG9(z, a, b, c, d, e, f, g, h, i) z(a, b),  z(c, d), z(e, f), z(g, h)
-# define VIR_MOCK_GET_ARG10(z, a, b, c, d, e, f, g, h, i, j) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j)
-# define VIR_MOCK_GET_ARG11(z, a, b, c, d, e, f, g, h, i, j, k) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j)
-# define VIR_MOCK_GET_ARG12(z, a, b, c, d, e, f, g, h, i, j, k, l) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l)
-# define VIR_MOCK_GET_ARG13(z, a, b, c, d, e, f, g, h, i, j, k, l, m) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l)
-# define VIR_MOCK_GET_ARG14(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n)
-# define VIR_MOCK_GET_ARG15(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n)
-# define VIR_MOCK_GET_ARG16(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p)
-# define VIR_MOCK_GET_ARG17(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p)
-# define VIR_MOCK_GET_ARG18(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r)
-# define VIR_MOCK_GET_ARG19(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r)
-# define VIR_MOCK_GET_ARG20(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r), z(s, t)
-# define VIR_MOCK_GET_ARG21(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r), z(s, t)
-
-
-# define VIR_MOCK_ARGNAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
-# define VIR_MOCK_ARGNAMES(...) \
+#pragma once
+
+#if HAVE_DLFCN_H
+# include <dlfcn.h>
+#endif
+
+#include "internal.h"
+
+#define VIR_MOCK_COUNT_ARGS(...) VIR_MOCK_ARG21(__VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
+#define VIR_MOCK_ARG21(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, ...) _21
+#define VIR_MOCK_ARG_PASTE(a, b, ...) a##b(__VA_ARGS__)
+
+#define VIR_MOCK_ARGNAME(a, b) b
+#define VIR_MOCK_ARGTYPE(a, b) a
+#define VIR_MOCK_ARGTYPENAME(a, b) a b
+#define VIR_MOCK_ARGTYPENAME_UNUSED(a, b) a b ATTRIBUTE_UNUSED
+
+#define VIR_MOCK_GET_ARG2(z, a, b) z(a, b)
+#define VIR_MOCK_GET_ARG3(z, a, b, c) z(a, b)
+#define VIR_MOCK_GET_ARG4(z, a, b, c, d) z(a, b),  z(c, d)
+#define VIR_MOCK_GET_ARG5(z, a, b, c, d, e) z(a, b),  z(c, d)
+#define VIR_MOCK_GET_ARG6(z, a, b, c, d, e, f) z(a, b),  z(c, d), z(e, f)
+#define VIR_MOCK_GET_ARG7(z, a, b, c, d, e, f, g) z(a, b),  z(c, d), z(e, f)
+#define VIR_MOCK_GET_ARG8(z, a, b, c, d, e, f, g, h) z(a, b),  z(c, d), z(e, f), z(g, h)
+#define VIR_MOCK_GET_ARG9(z, a, b, c, d, e, f, g, h, i) z(a, b),  z(c, d), z(e, f), z(g, h)
+#define VIR_MOCK_GET_ARG10(z, a, b, c, d, e, f, g, h, i, j) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j)
+#define VIR_MOCK_GET_ARG11(z, a, b, c, d, e, f, g, h, i, j, k) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j)
+#define VIR_MOCK_GET_ARG12(z, a, b, c, d, e, f, g, h, i, j, k, l) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l)
+#define VIR_MOCK_GET_ARG13(z, a, b, c, d, e, f, g, h, i, j, k, l, m) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l)
+#define VIR_MOCK_GET_ARG14(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n)
+#define VIR_MOCK_GET_ARG15(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n)
+#define VIR_MOCK_GET_ARG16(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p)
+#define VIR_MOCK_GET_ARG17(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p)
+#define VIR_MOCK_GET_ARG18(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r)
+#define VIR_MOCK_GET_ARG19(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r)
+#define VIR_MOCK_GET_ARG20(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r), z(s, t)
+#define VIR_MOCK_GET_ARG21(z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) z(a, b),  z(c, d), z(e, f), z(g, h), z(i, j), z(k, l), z(m, n), z(o, p), z(q, r), z(s, t)
+
+
+#define VIR_MOCK_ARGNAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
+#define VIR_MOCK_ARGNAMES(...) \
     VIR_MOCK_ARGNAMES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_ARGS__), VIR_MOCK_ARGNAME, __VA_ARGS__)
 
-# define VIR_MOCK_ARGTYPES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
-# define VIR_MOCK_ARGTYPES(...) \
+#define VIR_MOCK_ARGTYPES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
+#define VIR_MOCK_ARGTYPES(...) \
     VIR_MOCK_ARGTYPES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_ARGS__), VIR_MOCK_ARGTYPE, __VA_ARGS__)
 
-# define VIR_MOCK_ARGTYPENAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
-# define VIR_MOCK_ARGTYPENAMES(...) \
+#define VIR_MOCK_ARGTYPENAMES_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
+#define VIR_MOCK_ARGTYPENAMES(...) \
     VIR_MOCK_ARGTYPENAMES_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_ARGS__), VIR_MOCK_ARGTYPENAME, __VA_ARGS__)
 
-# define VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
-# define VIR_MOCK_ARGTYPENAMES_UNUSED(...) \
+#define VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(a, b, ...) VIR_MOCK_ARG_PASTE(a, b, __VA_ARGS__)
+#define VIR_MOCK_ARGTYPENAMES_UNUSED(...) \
     VIR_MOCK_ARGTYPENAMES_UNUSED_EXPAND(VIR_MOCK_GET_ARG, VIR_MOCK_COUNT_ARGS(__VA_ARGS__), VIR_MOCK_ARGTYPENAME_UNUSED, __VA_ARGS__)
 
 
@@ -98,7 +97,7 @@
  * Define a replacement for @name which invokes wrap_@name
  * forwarding on all args, and passing back the return value.
  */
-# define VIR_MOCK_LINK_RET_ARGS(name, rettype, ...) \
+#define VIR_MOCK_LINK_RET_ARGS(name, rettype, ...) \
     rettype name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)) \
     { \
         static rettype (*wrap_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
  * Define a replacement for @name which invokes wrap_@name
  * with no arguments, and passing back the return value.
  */
-# define VIR_MOCK_LINK_RET_VOID(name, rettype) \
+#define VIR_MOCK_LINK_RET_VOID(name, rettype) \
     rettype name(void) \
     { \
         static rettype (*wrap_##name)(void); \
  * Define a replacement for @name which invokes wrap_@name
  * forwarding on all args, but with no return value.
  */
-# define VIR_MOCK_LINK_VOID_ARGS(name, ...) \
+#define VIR_MOCK_LINK_VOID_ARGS(name, ...) \
     void name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)) \
     { \
         static void (*wrap_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
  * Define a replacement for @name which doesn't invoke anything, just
  * returns @retval.
  */
-# define VIR_MOCK_STUB_RET_ARGS(name, rettype, retval, ...) \
+#define VIR_MOCK_STUB_RET_ARGS(name, rettype, retval, ...) \
     rettype name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) \
     { \
         return retval; \
  * Define a replacement for @name which doesn't invoke anything, just
  * returns @retval.
  */
-# define VIR_MOCK_STUB_RET_VOID(name, rettype, retval) \
+#define VIR_MOCK_STUB_RET_VOID(name, rettype, retval) \
     rettype name(void) \
     { \
         return retval; \
  * Define a replacement for @name which doesn't invoke or return
  * anything.
  */
-# define VIR_MOCK_STUB_VOID_ARGS(name, ...) \
+#define VIR_MOCK_STUB_VOID_ARGS(name, ...) \
     void name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__)) \
     { \
     }
  * Define a replacement for @name which doesn't invoke or return
  * anything.
  */
-# define VIR_MOCK_STUB_VOID_VOID(name) \
+#define VIR_MOCK_STUB_VOID_VOID(name) \
     void name(void) \
     { \
     }
  * as the body of the method.
  */
 
-# define VIR_MOCK_IMPL_RET_ARGS(name, rettype, ...) \
+#define VIR_MOCK_IMPL_RET_ARGS(name, rettype, ...) \
     rettype name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \
     static rettype (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
     rettype name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__))
 
-# define VIR_MOCK_IMPL_RET_VOID(name, rettype) \
+#define VIR_MOCK_IMPL_RET_VOID(name, rettype) \
     rettype name(void); \
     static rettype (*real_##name)(void); \
     rettype name(void)
 
-# define VIR_MOCK_IMPL_VOID_ARGS(name, ...) \
+#define VIR_MOCK_IMPL_VOID_ARGS(name, ...) \
     void name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \
     static void (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
     void name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__))
 
-# define VIR_MOCK_IMPL_VOID_VOID(name) \
+#define VIR_MOCK_IMPL_VOID_VOID(name) \
     void name(void); \
     static void (*real_##name)(void); \
     void name(void)
  * as the body of the method.
  */
 
-# define VIR_MOCK_WRAP_RET_ARGS(name, rettype, ...) \
+#define VIR_MOCK_WRAP_RET_ARGS(name, rettype, ...) \
     rettype wrap_##name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \
     static rettype (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
     rettype wrap_##name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__))
 
-# define VIR_MOCK_WRAP_RET_VOID(name, rettype) \
+#define VIR_MOCK_WRAP_RET_VOID(name, rettype) \
     rettype wrap_##name(void); \
     static rettype (*real_##name)(void); \
     rettype wrap_##name(void)
 
-# define VIR_MOCK_WRAP_VOID_ARGS(name, ...) \
+#define VIR_MOCK_WRAP_VOID_ARGS(name, ...) \
     void wrap_##name(VIR_MOCK_ARGTYPENAMES(__VA_ARGS__)); \
     static void (*real_##name)(VIR_MOCK_ARGTYPES(__VA_ARGS__)); \
     void wrap_##name(VIR_MOCK_ARGTYPENAMES_UNUSED(__VA_ARGS__))
 
-# define VIR_MOCK_WRAP_VOID_VOID(name) \
+#define VIR_MOCK_WRAP_VOID_VOID(name) \
     void wrap_##name(void); \
     static void (*real_##name)(void); \
     void wrap_##name(void)
 
 
-# define VIR_MOCK_REAL_INIT(name) \
+#define VIR_MOCK_REAL_INIT(name) \
     do { \
         if (real_##name == NULL && \
             !(real_##name = dlsym(RTLD_NEXT, \
             abort(); \
         } \
     } while (0)
-
-#endif /* LIBVIRT_VIRMOCK_H */
index 3315a054e40b84674581c231b618f7fdd8b377f3..4c6f5e8c3139e80d6844a633a637aa9e54e2ba65 100644 (file)
  * <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LIBVIRT_VIRNETTLSHELPERS_H
-# define LIBVIRT_VIRNETTLSHELPERS_H
+#pragma once
 
-# include <gnutls/gnutls.h>
-# include <gnutls/x509.h>
+#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
 
-# if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
+#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600
 
-#  include <libtasn1.h>
+# include <libtasn1.h>
 
-#  include "rpc/virnettlscontext.h"
+# include "rpc/virnettlscontext.h"
 
 /*
  * This contains parameter about how to generate
@@ -77,6 +76,4 @@ void testTLSDiscardCert(struct testTLSCertReq *req);
 void testTLSInit(const char *keyfile);
 void testTLSCleanup(const char *keyfile);
 
-# endif
-
-#endif /* LIBVIRT_VIRNETTLSHELPERS_H */
+#endif