[Spice-commits] docs/spice_style.txt

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu May 12 14:29:41 UTC 2016


 docs/spice_style.txt |   33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

New commits:
commit 7673b388f5c8479f8f8184a46543f68d3ca7fc22
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu May 12 15:27:46 2016 +0100

    style: put some notes on inclusion order
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 7de4a43..b042d79 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 <system_headers.h>
+#include <no_spice_no_system_libraries.h>
+#include <spice_protocol.h>
+#include <spice_common.h>
+
+#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 <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"
+----


More information about the Spice-commits mailing list