All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules
@ 2014-02-26 22:31 Fam Zheng
  2014-02-27  2:58 ` Hu Tao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fam Zheng @ 2014-02-26 22:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, hutao, Peter Maydell

Compiling util/modules.c with modules enabled fails now.

Fix it by including qemu-common.h before #ifdef testing in module.c.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 util/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/module.c b/util/module.c
index dc08c16..863a8a3 100644
--- a/util/module.c
+++ b/util/module.c
@@ -14,10 +14,10 @@
  */
 
 #include <stdlib.h>
+#include "qemu-common.h"
 #ifdef CONFIG_MODULES
 #include <gmodule.h>
 #endif
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/module.h"
 
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules
  2014-02-26 22:31 [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules Fam Zheng
@ 2014-02-27  2:58 ` Hu Tao
  2014-02-27  7:41 ` Markus Armbruster
  2014-02-28 12:57 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Hu Tao @ 2014-02-27  2:58 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Paolo Bonzini, qemu-devel, Peter Maydell

On Thu, Feb 27, 2014 at 06:31:33AM +0800, Fam Zheng wrote:
> Compiling util/modules.c with modules enabled fails now.
> 
> Fix it by including qemu-common.h before #ifdef testing in module.c.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  util/module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/module.c b/util/module.c
> index dc08c16..863a8a3 100644
> --- a/util/module.c
> +++ b/util/module.c
> @@ -14,10 +14,10 @@
>   */
>  
>  #include <stdlib.h>
> +#include "qemu-common.h"
>  #ifdef CONFIG_MODULES
>  #include <gmodule.h>
>  #endif
> -#include "qemu-common.h"
>  #include "qemu/queue.h"
>  #include "qemu/module.h"
>  
> -- 
> 1.9.0

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules
  2014-02-26 22:31 [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules Fam Zheng
  2014-02-27  2:58 ` Hu Tao
@ 2014-02-27  7:41 ` Markus Armbruster
  2014-02-28 12:57 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2014-02-27  7:41 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Peter Maydell, Paolo Bonzini, qemu-devel, hutao

Fam Zheng <famz@redhat.com> writes:

> Compiling util/modules.c with modules enabled fails now.
>
> Fix it by including qemu-common.h before #ifdef testing in module.c.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  util/module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/util/module.c b/util/module.c
> index dc08c16..863a8a3 100644
> --- a/util/module.c
> +++ b/util/module.c
> @@ -14,10 +14,10 @@
>   */
>  
>  #include <stdlib.h>
> +#include "qemu-common.h"
>  #ifdef CONFIG_MODULES
>  #include <gmodule.h>
>  #endif
> -#include "qemu-common.h"
>  #include "qemu/queue.h"
>  #include "qemu/module.h"

I'm not objecting to quickly fixing the build this way.

However, your patch violates the rule "external headers before our own
headers".  The rule exists to avoid our headers messing up the external
ones.

I like Autoconf's convention to solve this problem: every .c includes
the header generated by configure before anything else, and nothing else
includes it.  This ensures that all our code sees the configuration
defines, and that external headers get only exposed to configuration
defines, not to random other crap.

Opinions?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules
  2014-02-26 22:31 [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules Fam Zheng
  2014-02-27  2:58 ` Hu Tao
  2014-02-27  7:41 ` Markus Armbruster
@ 2014-02-28 12:57 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-02-28 12:57 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Paolo Bonzini, QEMU Developers, Hu Tao

On 26 February 2014 22:31, Fam Zheng <famz@redhat.com> wrote:
> Compiling util/modules.c with modules enabled fails now.
>
> Fix it by including qemu-common.h before #ifdef testing in module.c.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-28 12:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26 22:31 [Qemu-devel] [PATCH v2] modules: Fix building with --enable-modules Fam Zheng
2014-02-27  2:58 ` Hu Tao
2014-02-27  7:41 ` Markus Armbruster
2014-02-28 12:57 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.