[Libvir] more missing #include's of "config.h"

This is the last of the non-generated files requiring #include "config.h": Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise. * proxy/libvirt_proxy.c: Likewise. * python/libvir.c: Likewise. * python/types.c: Likewise. * src/event.c: Likewise. * src/xm_internal.c: Likewise. * tests/reconnect.c: Likewise. * tests/testutils.c: Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com> --- docs/examples/info1.c | 2 ++ docs/examples/suspend.c | 2 ++ proxy/libvirt_proxy.c | 4 +++- python/libvir.c | 4 +++- python/types.c | 4 +++- src/event.c | 1 + src/xm_internal.c | 2 ++ tests/reconnect.c | 2 ++ tests/testutils.c | 2 ++ 9 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/examples/info1.c b/docs/examples/info1.c index f17bde8..53a9844 100644 --- a/docs/examples/info1.c +++ b/docs/examples/info1.c @@ -9,6 +9,8 @@ * copy: see Copyright for the status of this software. */ +#include "config.h" + #include <stdio.h> #include <libvirt/libvirt.h> diff --git a/docs/examples/suspend.c b/docs/examples/suspend.c index 80e4da7..5bc47a4 100644 --- a/docs/examples/suspend.c +++ b/docs/examples/suspend.c @@ -11,6 +11,8 @@ * copy: see Copyright for the status of this software. */ +#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <libvirt/libvirt.h> diff --git a/proxy/libvirt_proxy.c b/proxy/libvirt_proxy.c index d7deb44..152df56 100644 --- a/proxy/libvirt_proxy.c +++ b/proxy/libvirt_proxy.c @@ -2,13 +2,15 @@ * proxy_svr.c: root suid proxy server for Xen access to APIs with no * side effects from unauthenticated clients. * - * Copyright (C) 2006 Red Hat, Inc. + * Copyright (C) 2006, 2007 Red Hat, Inc. * * See COPYING.LIB for the License of this software * * Daniel Veillard <veillard@redhat.com> */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <unistd.h> diff --git a/python/libvir.c b/python/libvir.c index bab34b3..a025afd 100644 --- a/python/libvir.c +++ b/python/libvir.c @@ -4,11 +4,13 @@ * entry points where an automatically generated stub is * unpractical * - * Copyright (C) 2005 Red Hat, Inc. + * Copyright (C) 2005, 2007 Red Hat, Inc. * * Daniel Veillard <veillard@redhat.com> */ +#include "config.h" + #include <Python.h> #include "libvirt/libvirt.h" #include "libvirt/virterror.h" diff --git a/python/types.c b/python/types.c index cc0f2b1..146bb24 100644 --- a/python/types.c +++ b/python/types.c @@ -2,11 +2,13 @@ * types.c: converter functions between the internal representation * and the Python objects * - * Copyright (C) 2005 Red Hat, Inc. + * Copyright (C) 2005, 2007 Red Hat, Inc. * * Daniel Veillard <veillard@redhat.com> */ +#include "config.h" + #include "libvirt_wrap.h" PyObject * diff --git a/src/event.c b/src/event.c index 2fe9a26..7dcbf32 100644 --- a/src/event.c +++ b/src/event.c @@ -21,6 +21,7 @@ * Author: Daniel P. Berrange <berrange@redhat.com> */ +#include "config.h" #include "event.h" diff --git a/src/xm_internal.c b/src/xm_internal.c index 43263d7..07abbb1 100644 --- a/src/xm_internal.c +++ b/src/xm_internal.c @@ -23,6 +23,8 @@ */ #ifdef WITH_XEN +#include "config.h" + #include <dirent.h> #include <time.h> #include <sys/stat.h> diff --git a/tests/reconnect.c b/tests/reconnect.c index 246e3bb..d94f5c7 100644 --- a/tests/reconnect.c +++ b/tests/reconnect.c @@ -1,3 +1,5 @@ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include "libvirt/libvirt.h" diff --git a/tests/testutils.c b/tests/testutils.c index 6121785..1141edb 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -10,6 +10,8 @@ * $Id$ */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <sys/time.h> -- 1.5.3.7.1006.g8c6a6

On Thu, Dec 06, 2007 at 06:32:24PM +0100, Jim Meyering wrote:
This is the last of the non-generated files requiring #include "config.h":
Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise.
For those 2 files I don't agree with adding it, they are example files showing how to use the API and config.h is an internal header, those user level examples should really not include it. But for the other case this looks fine to me, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

Daniel Veillard wrote:
On Thu, Dec 06, 2007 at 06:32:24PM +0100, Jim Meyering wrote:
This is the last of the non-generated files requiring #include "config.h":
Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise.
For those 2 files I don't agree with adding it, they are example files showing how to use the API and config.h is an internal header, those user level examples should really not include it. But for the other case this looks fine to me,
Same comment. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Dec 06, 2007 at 06:32:24PM +0100, Jim Meyering wrote:
This is the last of the non-generated files requiring #include "config.h":
Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise.
Hi Daniel,
For those 2 files I don't agree with adding it, they are example files showing how to use the API and config.h is an internal header, those user level examples should really not include it.
Don't you think people will understand that? Would a comment help? "config.h" really is required in every .c file that's compiled as part of a build. If it's not, you're asking for build failures whenever you encounter a compiler with e.g, insufficient "const" support. This is an issue even with those simple example files, since there are uses of "const" in libvirt.h, which is included by each of those two. On a build host with a deficient compiler, the config.h-supplied definition of "const" is required in that case. Each also includes stdio.h, which (with gnulib) requires

Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Dec 06, 2007 at 06:32:24PM +0100, Jim Meyering wrote:
This is the last of the non-generated files requiring #include "config.h":
Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise.
For those 2 files I don't agree with adding it, they are example files showing how to use the API and config.h is an internal header, those user level examples should really not include it. But for the other case this looks fine to me,
How about if I guard it with #ifdef HAVE_CONFIG_H #endif

Jim Meyering wrote:
Daniel Veillard <veillard@redhat.com> wrote:
On Thu, Dec 06, 2007 at 06:32:24PM +0100, Jim Meyering wrote:
This is the last of the non-generated files requiring #include "config.h":
Include "config.h" in remaining non-generated files. * docs/examples/info1.c: Likewise. * docs/examples/suspend.c: Likewise. For those 2 files I don't agree with adding it, they are example files showing how to use the API and config.h is an internal header, those user level examples should really not include it. But for the other case this looks fine to me,
How about if I guard it with
#ifdef HAVE_CONFIG_H
#endif
Yup, sounds like a good idea. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (3)
-
Daniel Veillard
-
Jim Meyering
-
Richard W.M. Jones