[Libguestfs] [common/libguestfs PATCH] utils: conditionally include config.h on HAVE_CONFIG_H

Pino Toscano ptoscano at redhat.com
Thu Jan 9 17:18:33 UTC 2020


autotools define HAVE_CONFIG_H to signal a config.h was generated; since
this file is built directly also in bindings without the use of
config.h, make sure config.h is not requested in those cases.

This file uses only POSIX functions anyway, so it should not be a
problem.
---
 utils/stringlists-utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils/stringlists-utils.c b/utils/stringlists-utils.c
index 92c8030..97ad360 100644
--- a/utils/stringlists-utils.c
+++ b/utils/stringlists-utils.c
@@ -23,7 +23,9 @@
  * such as C<safe_*>, C<error> or C<perrorf>, or any C<guestfs_int_*>.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <string.h>
-- 
2.24.1




More information about the Libguestfs mailing list