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

[libvirt] [PATCH] HACKING: add a section on preprocessor conventions

* HACKING: Document recently-discussed style issues.

Signed-off-by: Eric Blake <eblake redhat com>

Turn recent discussions:

into policy, so I don't keep debating style points ;)

Can wait till after 0.7.7 (particularly since the vararg macro
series is also waiting).

 HACKING |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/HACKING b/HACKING
index be8725d..50b24ee 100644
@@ -102,6 +102,17 @@ Usually they're in macro definitions or strings, and should be converted

+For variadic macros, stick with C99 syntax:
+#define vshPrint(_ctl, ...)   fprintf(stdout, __VA_ARGS__)
+Use parenthesis when checking if a macro is defined:
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE)
 C types
 Use the right type.

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