From 48e7520ec55b665a267bc638882b9c168742f6c9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 6 Apr 2021 13:29:56 +0100 Subject: [PATCH] lib/guestfs-internal.h: Remove need to include gnulib "hash.h" here. Centrally including "hash.h" means everything that needs this header file (everything in lib/) has to depend on gnulib. --- lib/guestfs-internal.h | 11 +++++++---- lib/handle.c | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h index 515c4fd24..b3f887935 100644 --- a/lib/guestfs-internal.h +++ b/lib/guestfs-internal.h @@ -37,6 +37,13 @@ #include +#include "guestfs-utils.h" + +/* Defined in gnulib "hash.h", but we explicitly define it here to + * avoid having to include that header everywhere. + */ +typedef struct hash_table Hash_table; + /* Minimum required version of libvirt for the libvirt backend. * * This is also checked at runtime because you can dynamically link @@ -56,10 +63,6 @@ #endif #endif -#include "hash.h" - -#include "guestfs-utils.h" - #if ENABLE_PROBES #include /* NB: The 'name' parameter is a literal identifier, NOT a string! */ diff --git a/lib/handle.c b/lib/handle.c index 1ba60aaa8..290652d8c 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -31,6 +31,7 @@ #include #include +#include "hash.h" #include "ignore-value.h" #include "c-ctype.h" #include "getprogname.h"