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

Frediano Ziglio fziglio at redhat.com
Wed May 11 16:33:38 UTC 2016


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



More information about the Spice-devel mailing list