diff options
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 83a2011545a..665226e4d1b 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -685,12 +685,22 @@ extern bool BLI_memory_is_zero(const void *arr, const size_t arr_size); # define UNUSED(x) UNUSED_##x #endif +/** + * WARNING: this doesn't warn when returning pointer types (because of the placement of `*`). + * Use #UNUSED_FUNCTION_WITH_RETURN_TYPE instead in this case. + */ #if defined(__GNUC__) || defined(__clang__) # define UNUSED_FUNCTION(x) __attribute__((__unused__)) UNUSED_##x #else # define UNUSED_FUNCTION(x) UNUSED_##x #endif +#if defined(__GNUC__) || defined(__clang__) +# define UNUSED_FUNCTION_WITH_RETURN_TYPE(rtype, x) __attribute__((__unused__)) rtype UNUSED_##x +#else +# define UNUSED_FUNCTION_WITH_RETURN_TYPE(rtype, x) rtype UNUSED_##x +#endif + /** * UNUSED_VARS#(a, ...): quiet unused warnings * |