diff options
author | ola.soder@axis.com <ola.soder@axis.com> | 2022-02-11 19:27:55 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-02-11 19:27:55 +0000 |
commit | bd89d4406327d3a30517443a4a518f49ebc99368 (patch) | |
tree | 4ce9a02abd758ab964130f1e93fd72efbb5dbe0d | |
parent | 481acb11413a436653e235d2098990b2ad47d195 (diff) |
patch 8.2.4347: in some build setups UNUSED is not definedv8.2.4347
Problem: In some build setups UNUSED is not defined.
Solution: Change the logic of how UNUSED is defined. (Ola Söder,
closes #9734)
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim.h | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/version.c b/src/version.c index 07e46ae95e..f7599c0d08 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4347, +/**/ 4346, /**/ 4345, @@ -245,12 +245,19 @@ // Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter // can be used to check for mistakes. -#if defined(HAVE_ATTRIBUTE_UNUSED) || defined(__MINGW32__) -# if !defined(UNUSED) +#ifndef UNUSED +# if defined(HAVE_ATTRIBUTE_UNUSED) || defined(__MINGW32__) # define UNUSED __attribute__((unused)) +# else +# if defined __has_attribute +# if __has_attribute(unused) +# define UNUSED __attribute__((unused)) +# endif +# endif +# endif +# ifndef UNUSED +# define UNUSED # endif -#else -# define UNUSED #endif // Used to check for "sun", "__sun" is used by newer compilers. |