[v4,03/12] Specify file extensions for C++ and Obj-C

Submitted by Christophe de Dinechin on Feb. 15, 2018, 4:06 p.m.

Details

Message ID 20180215160625.75406-4-christophe@dinechin.org
State New
Headers show
Series "Updates to the style guide" ( rev: 3 ) in Spice

Not browsing as part of any series.

Commit Message

Christophe de Dinechin Feb. 15, 2018, 4:06 p.m.
From: Christophe de Dinechin <dinechin@redhat.com>

Note that we don't have .m files in the repository yet, but some files
actually require building as Objective-C on some platformsdue to
system header dependencies (e.g. <AppKit.h>. This is currently worked
around by passing the CFLAGS=-ObjC command-line option explicitly.

Changes since v3:
- Extended commit log with rationale

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
---
 docs/spice_style.txt | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 7bb3e1fc..5dc41cb1 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -48,7 +48,16 @@  Names
 
 Use lower case and separate words using dashes (e.g., file-name.c, header.h).
 
-Use standard file extension for C source and header files.
+The file extensions used in the SPICE project are:
+- .c for C source
+- .cpp for C++ sources
+- .h for headers that can be included from C code
+- .hpp for headers that are strictly reserved to C++
+- .m for Objective-C source files
+
+Note that .h headers may contain C++ code as long as the header can
+successfully be included from a C source file.
+
 
 Line width
 ~~~~~~~~~~