[Spice-devel] [PATCH] style: put some notes on inclusion order

Christophe Fergeau cfergeau at redhat.com
Thu May 12 14:09:52 UTC 2016


Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Wed, May 11, 2016 at 05:33:38PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  docs/spice_style.txt | 31 +++++++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> index 7de4a43..1574aef 100644
> --- a/docs/spice_style.txt
> +++ b/docs/spice_style.txt
> @@ -307,3 +307,34 @@ char *array[] = {
>      "item_2",
>      "item_3",
>  };
> +
> +Header inclusion
> +----------------
> +
> +Headers should be included in this order
> +
> +[source,c]
> +----
> +#include <system_headers.h>
> +#include <no_spice_no_system_libraries.h>
> +#include <spice_protocol.h>
> +#include <spice_common.h>
> +
> +#include "spice_server.h"
> +----
> +
> +Also in source (no header) files you must include `config.h` at the beginning so should start (beside comments and copyright) with
> +
> +[source,c]
> +----
> +#ifdef HAVE_CONFIG_H
> +#include <config.h>
> +#endif
> +
> +#include <system_headers.h>
> +#include <no_spice_no_system_libraries.h>
> +#include <spice_protocol.h>
> +#include <spice_common.h>
> +
> +#include "spice_server.h"
> +----
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160512/f7147a82/attachment.sig>


More information about the Spice-devel mailing list