]> granicus.if.org Git - git/commitdiff
commit-slabs: move MAYBE_UNUSED out
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Tue, 23 Oct 2018 21:50:19 +0000 (14:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Oct 2018 05:52:50 +0000 (14:52 +0900)
after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18)
it is expected to be used to prevent -Wunused-function warnings for code
that was macro generated

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-slab-impl.h
git-compat-util.h

index ac1e6d409ad6cf1109f1e439944bd2fb1ab9e58e..5c0eb91a5d175ddb079459a0ba13b9be1f74b1ab 100644 (file)
@@ -1,10 +1,10 @@
 #ifndef COMMIT_SLAB_IMPL_H
 #define COMMIT_SLAB_IMPL_H
 
-#define MAYBE_UNUSED __attribute__((__unused__))
+#include "git-compat-util.h"
 
 #define implement_static_commit_slab(slabname, elemtype) \
-       implement_commit_slab(slabname, elemtype, static MAYBE_UNUSED)
+       implement_commit_slab(slabname, elemtype, MAYBE_UNUSED static)
 
 #define implement_shared_commit_slab(slabname, elemtype) \
        implement_commit_slab(slabname, elemtype, )
index 48c955541e2000239f861bdf7dd5043fa741674c..8121b73b4a98e896994054d4369143bdb0b71a99 100644 (file)
@@ -408,6 +408,8 @@ static inline char *git_find_last_dir_sep(const char *path)
 #define LAST_ARG_MUST_BE_NULL
 #endif
 
+#define MAYBE_UNUSED __attribute__((__unused__))
+
 #include "compat/bswap.h"
 
 #include "wildmatch.h"