]> granicus.if.org Git - vim/commitdiff
patch 8.2.4347: in some build setups UNUSED is not defined v8.2.4347
authorola.soder@axis.com <ola.soder@axis.com>
Fri, 11 Feb 2022 19:27:55 +0000 (19:27 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 11 Feb 2022 19:27:55 +0000 (19:27 +0000)
Problem:    In some build setups UNUSED is not defined.
Solution:   Change the logic of how UNUSED is defined. (Ola Söder,
            closes #9734)

src/version.c
src/vim.h

index 07e46ae95ec1fad8204e504d49cc32130094123a..f7599c0d082ddcfb2118fec1e445fed81784bcf9 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4347,
 /**/
     4346,
 /**/
index 166edf579f34b873453fe205f3ea7597308ad1dd..4f95bb45f27daf26ede2d39643048612f2ec3d01 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
 
 // 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.