[spice-server] style: Specify the possibility of "pragma once" usage

Submitted by Frediano Ziglio on Aug. 12, 2019, 6:56 a.m.

Details

Message ID 20190812065656.6875-1-fziglio@redhat.com
State Accepted
Commit 2379fcd6a50dbf39801080c44cb6640702f3e02d
Headers show
Series "style: Specify the possibility of "pragma once" usage" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Aug. 12, 2019, 6:56 a.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 docs/spice_style.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index e4d7fc6d1..89a550fb8 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -372,6 +372,15 @@  The macro may include additional information, e.g. a component. For example a fi
 
 Historically, some headers added underscores liberally, e.g. MY_MODULE_H_. This is neither necessary nor discouraged, although as a reminder, a leading underscore followed by a capital letter is reserved for the implementation and should not be used, so _MY_MODULE_H is, technically speaking, invalid C.
 
+Alternatively (recommended on newer code) you can use the `pragma once` directive, as:
+
+[source,c]
+----
+#pragma once
+
+...
+----
+
 Header inclusion
 ----------------
 

Comments

Acked-by: Snir Sheriber <ssheribe@redhat.com>

On 8/12/19 9:56 AM, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>   docs/spice_style.txt | 9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> index e4d7fc6d1..89a550fb8 100644
> --- a/docs/spice_style.txt
> +++ b/docs/spice_style.txt
> @@ -372,6 +372,15 @@ The macro may include additional information, e.g. a component. For example a fi
>   
>   Historically, some headers added underscores liberally, e.g. MY_MODULE_H_. This is neither necessary nor discouraged, although as a reminder, a leading underscore followed by a capital letter is reserved for the implementation and should not be used, so _MY_MODULE_H is, technically speaking, invalid C.
>   
> +Alternatively (recommended on newer code) you can use the `pragma once` directive, as:
> +
> +[source,c]
> +----
> +#pragma once
> +
> +...
> +----
> +
>   Header inclusion
>   ----------------
>