[Spice-devel] [PATCH 13/15] common: don't try to redefine PANIC if it already exists

Christophe Fergeau cfergeau at redhat.com
Thu Apr 21 04:53:38 PDT 2011


canvas_base.c tries to define PANIC, but it might already be set
if eg client/debug.h has been included before. All the other
macros in this file are guarded by #ifndef, this commit adds
the missing #ifndef to PANIC. Note that this is just a bandaid,
ideally common/ would contain a logging frameword, and these
macros would only be defined once instead of being defined in
several places.
---
 common/canvas_base.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 796bda3..4dedfcf 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -53,10 +53,12 @@
 #define WARN(x) printf("warning: %s\n", x)
 #endif
 
+#ifndef PANIC
 #define PANIC(str) {                                \
     printf("%s: panic: %s", __FUNCTION__, str);     \
     abort();                                        \
 }
+#endif
 
 #ifndef DBG
 #define DBG(level, format, ...) printf("%s: debug: " format "\n", __FUNCTION__, ## __VA_ARGS__);
-- 
1.7.4.4



More information about the Spice-devel mailing list