[PATCH v2 11/13] Add mention of header guards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Christophe de Dinechin <dinechin@xxxxxxxxxx>

Signed-off-by: Christophe de Dinechin <dinechin@xxxxxxxxxx>
---
 docs/spice_style.txt | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 780f0615..e2465aa9 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -357,6 +357,21 @@ char *array[] = {
     "item_3",
 };
 
+Headers
+-------
+
+Headers should be protected against multiple inclusion using a macro that matches the header file name in uppercase, with all characters that are invalid in C replaced with an underscore '_':
+
+[source,h]
+---
+#ifndef MY_MODULE_H
+#define MY_MODULE_H
+
+...
+
+#endif /* MY_MODULE_H */
+---
+
 Header inclusion
 ----------------
 
-- 
2.13.5 (Apple Git-94)

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]