summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-04-21 12:05:19 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2011-05-02 11:24:44 +0200
commit9496a7864e6d456977cc9f6c18768d59cfe0d9ba (patch)
tree90903488aede074781db1e47931f31c8db6b80da /common
parent2f187d5a71341747a076bf0e1addc3462572c466 (diff)
downloadspice-9496a7864e6d456977cc9f6c18768d59cfe0d9ba.tar.gz
spice-9496a7864e6d456977cc9f6c18768d59cfe0d9ba.tar.xz
spice-9496a7864e6d456977cc9f6c18768d59cfe0d9ba.zip
common: don't try to redefine PANIC if it already exists
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.
Diffstat (limited to 'common')
-rw-r--r--common/canvas_base.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index 796bda31..4dedfcf4 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__);