mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-01-08 21:14:20 +00:00
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:
parent
57b6e08160
commit
eda7b8938a
@ -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__);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user