[Qemu-devel] [PATCH 10/19] include/hw/or-irq.h: Add missing include guard

Peter Maydell posted 19 patches 7 years, 4 months ago
[Qemu-devel] [PATCH 10/19] include/hw/or-irq.h: Add missing include guard
Posted by Peter Maydell 7 years, 4 months ago
The or-irq.h header file is missing the customary guard against
multiple inclusion, which means compilation fails if it gets
included twice. Fix the omission.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/hw/or-irq.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/hw/or-irq.h b/include/hw/or-irq.h
index fd900fcf19..3f6fc1b58a 100644
--- a/include/hw/or-irq.h
+++ b/include/hw/or-irq.h
@@ -22,6 +22,9 @@
  * THE SOFTWARE.
  */
 
+#ifndef HW_OR_IRQ_H
+#define HW_OR_IRQ_H
+
 #include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "qom/object.h"
@@ -41,3 +44,5 @@ struct OrIRQState {
     bool levels[MAX_OR_LINES];
     uint16_t num_lines;
 };
+
+#endif
-- 
2.16.1


Re: [Qemu-devel] [PATCH 10/19] include/hw/or-irq.h: Add missing include guard
Posted by Philippe Mathieu-Daudé 7 years, 4 months ago
On 02/20/2018 03:03 PM, Peter Maydell wrote:
> The or-irq.h header file is missing the customary guard against
> multiple inclusion, which means compilation fails if it gets
> included twice. Fix the omission.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  include/hw/or-irq.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/hw/or-irq.h b/include/hw/or-irq.h
> index fd900fcf19..3f6fc1b58a 100644
> --- a/include/hw/or-irq.h
> +++ b/include/hw/or-irq.h
> @@ -22,6 +22,9 @@
>   * THE SOFTWARE.
>   */
>  
> +#ifndef HW_OR_IRQ_H
> +#define HW_OR_IRQ_H
> +
>  #include "hw/irq.h"
>  #include "hw/sysbus.h"
>  #include "qom/object.h"
> @@ -41,3 +44,5 @@ struct OrIRQState {
>      bool levels[MAX_OR_LINES];
>      uint16_t num_lines;
>  };
> +
> +#endif
> 

Re: [Qemu-devel] [PATCH 10/19] include/hw/or-irq.h: Add missing include guard
Posted by Richard Henderson 7 years, 4 months ago
On 02/20/2018 10:03 AM, Peter Maydell wrote:
> The or-irq.h header file is missing the customary guard against
> multiple inclusion, which means compilation fails if it gets
> included twice. Fix the omission.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  include/hw/or-irq.h | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~