diff options
| author | 3gg <3gg@shellblade.net> | 2024-04-13 12:21:14 -0700 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2024-04-13 12:21:36 -0700 |
| commit | 9369eb452e290d3d125ac4f9abf9cb8012e08ad7 (patch) | |
| tree | df7a741b370b7bbad66398a1a17a1f021a49dc2b | |
| parent | afe1e1d12e42a0881aff63c766c14e48319b560c (diff) | |
Undef log macros if they are already defined to redefine them without warnings.
| -rw-r--r-- | log/include/log/log.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/log/include/log/log.h b/log/include/log/log.h index 8f12b09..bd0c20c 100644 --- a/log/include/log/log.h +++ b/log/include/log/log.h | |||
| @@ -2,6 +2,14 @@ | |||
| 2 | 2 | ||
| 3 | #include <stdio.h> | 3 | #include <stdio.h> |
| 4 | 4 | ||
| 5 | // Undef any previously defined log macros (from cassert.h, for example) to | ||
| 6 | // redefine them without compiler warnings. | ||
| 7 | #undef LOG | ||
| 8 | #undef LOGD | ||
| 9 | #undef LOGI | ||
| 10 | #undef LOGW | ||
| 11 | #undef LOGE | ||
| 12 | |||
| 5 | #define LOG(channel, tag, format, ...) \ | 13 | #define LOG(channel, tag, format, ...) \ |
| 6 | { \ | 14 | { \ |
| 7 | fprintf( \ | 15 | fprintf( \ |
