From 7673b388f5c8479f8f8184a46543f68d3ca7fc22 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Thu, 12 May 2016 15:27:46 +0100 Subject: [PATCH] style: put some notes on inclusion order Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- docs/spice_style.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/spice_style.txt b/docs/spice_style.txt index 7de4a439..b042d794 100644 --- a/docs/spice_style.txt +++ b/docs/spice_style.txt @@ -307,3 +307,36 @@ char *array[] = { "item_2", "item_3", }; + +Header inclusion +---------------- + +Headers should be included in this order + +[source,c] +---- +#include +#include +#include +#include + +#include "spice_server.h" +---- + +(note the empty line between no spice-server and spice-server headers) + +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 +#endif + +#include +#include +#include +#include + +#include "spice_server.h" +----