mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-06-16 06:58:21 +02:00
util: ifndef the etrace and trace macros
This macros are incredibly useful to use globally so let's ifdef them out in case developers have them sitting around in global headers. Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/378>
This commit is contained in:
parent
aa5571ec08
commit
32abd87cc7
1 changed files with 2 additions and 0 deletions
|
|
@ -71,6 +71,7 @@
|
|||
static int _once_per_##__func__ = 0; \
|
||||
for (; _once_per_##__func__ == 0; _once_per_##__func__ = 1)
|
||||
|
||||
#if !defined(trace) && !defined(etrace)
|
||||
#define trace(...) \
|
||||
do { \
|
||||
char buf_[1024]; \
|
||||
|
|
@ -84,3 +85,4 @@
|
|||
snprintf(buf_, sizeof(buf_), __VA_ARGS__); \
|
||||
fprintf(stderr, "\x1B[0;34m" "%s():%d - " "\x1B[0;31m" "%s" "\x1B[0m" "\n", __func__, __LINE__, buf_); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue