mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-11 11:26:33 +00:00
style: put some notes on inclusion order
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
4585fa9cbd
commit
7673b388f5
@ -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"
|
||||
----
|
||||
|
||||
Loading…
Reference in New Issue
Block a user