diff options
Diffstat (limited to 'src/cc-compat.h')
-rw-r--r-- | src/cc-compat.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cc-compat.h b/src/cc-compat.h index de1469da8..6bdc65145 100644 --- a/src/cc-compat.h +++ b/src/cc-compat.h @@ -43,7 +43,15 @@ # define GIT_ALIGN(x,size) x #endif -#define GIT_UNUSED(x) ((void)(x)) +#if defined(__GNUC__) +# define GIT_UNUSED(x) \ + do { \ + typeof(x) _unused __attribute__((unused)); \ + _unused = (x); \ + } while (0) +#else +# define GIT_UNUSED(x) ((void)(x)) +#endif /* Define the printf format specifier to use for size_t output */ #if defined(_MSC_VER) || defined(__MINGW32__) |