diff options
author | Vladimir Kobal <vlad@prokk.net> | 2022-02-21 12:23:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 12:23:48 +0200 |
commit | d8b7b6a25f7fc0ec4d79a7f8a72c779e3bf4afd7 (patch) | |
tree | 8fba2db960467dcbbd3cba0660d1a874c16783db /libnetdata | |
parent | ad72a83afdd5fbd1075d1d1f3cc97edfdea4650e (diff) |
Fix compilation warnings on macOS (#12082)
Diffstat (limited to 'libnetdata')
-rw-r--r-- | libnetdata/libnetdata.h | 7 | ||||
-rw-r--r-- | libnetdata/threads/threads.c | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libnetdata/libnetdata.h b/libnetdata/libnetdata.h index 809cefa013..4a8ec1d26d 100644 --- a/libnetdata/libnetdata.h +++ b/libnetdata/libnetdata.h @@ -304,6 +304,13 @@ extern char *find_and_replace(const char *src, const char *find, const char *rep /* misc. */ #define UNUSED(x) (void)(x) + +#ifdef __GNUC__ +#define UNUSED_FUNCTION(x) __attribute__((unused)) UNUSED_##x +#else +#define UNUSED_FUNCTION(x) UNUSED_##x +#endif + #define error_report(x, args...) do { errno = 0; error(x, ##args); } while(0) // Taken from linux kernel diff --git a/libnetdata/threads/threads.c b/libnetdata/threads/threads.c index d7636940f7..12007afff5 100644 --- a/libnetdata/threads/threads.c +++ b/libnetdata/threads/threads.c @@ -147,6 +147,7 @@ void uv_thread_set_name_np(uv_thread_t ut, const char* name) { pthread_set_name_np(ut, threadname); #elif defined(__APPLE__) // Apple can only set its own name + UNUSED(ut); #else ret = pthread_setname_np(ut, threadname); #endif |