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.
This commit is contained in:
Christophe Fergeau 2011-04-21 12:05:19 +02:00 committed by Marc-André Lureau
parent 57b6e08160
commit eda7b8938a

View File

@ -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__);