All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules
@ 2010-08-12 17:49 Blue Swirl
  2010-08-12 18:47 ` malc
  0 siblings, 1 reply; 6+ messages in thread
From: Blue Swirl @ 2010-08-12 17:49 UTC (permalink / raw)
  To: qemu-devel

Add preprocessor rules from libvirt HACKING.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 CODING_STYLE |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/CODING_STYLE b/CODING_STYLE
index 92036f3..c4c09ab 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -79,3 +79,16 @@ and clarity it comes on a line by itself:
 Rationale: a consistent (except for functions...) bracing style reduces
 ambiguity and avoids needless churn when lines are added or removed.
 Furthermore, it is the QEMU coding style.
+
+5. Preprocessor
+
+For variadic macros, stick with C99 syntax:
+
+#define vshPrint(_ctl, ...)   fprintf(stdout, __VA_ARGS__)
+
+Use parenthesis when checking if a macro is defined, and use
+indentation to track nesting:
+
+#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE)
+# define fallocate(a,ignored,b,c) posix_fallocate(a,b,c)
+#endif
-- 
1.6.2.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-15  8:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12 17:49 [Qemu-devel] [PATCH 1/5] CODING_STYLE: add preprocessor rules Blue Swirl
2010-08-12 18:47 ` malc
2010-08-13 16:56   ` Blue Swirl
2010-08-14 14:27     ` Andreas Färber
2010-08-15  7:46       ` Blue Swirl
2010-08-15  7:59         ` Andreas Färber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.