summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-10-30 15:43:48 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-30 15:43:48 +0900
commitd1622fdbdd83831983e8b99250792e5fca7b9159 (patch)
treec3beb5f30ba119cfa361e222cdc1c8eb26b96509
parentMerge branch 'jc/cocci-preincr' (diff)
parentkhash: silence -Wunused-function for delta-islands (diff)
downloadtgif-d1622fdbdd83831983e8b99250792e5fca7b9159.tar.xz
Merge branch 'cb/khash-maybe-unused-function'
Build fix. * cb/khash-maybe-unused-function: khash: silence -Wunused-function for delta-islands commit-slabs: move MAYBE_UNUSED out
-rw-r--r--commit-slab-impl.h4
-rw-r--r--git-compat-util.h2
-rw-r--r--khash.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/commit-slab-impl.h b/commit-slab-impl.h
index ac1e6d409a..5c0eb91a5d 100644
--- a/commit-slab-impl.h
+++ b/commit-slab-impl.h
@@ -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, )
diff --git a/git-compat-util.h b/git-compat-util.h
index 95cfcc1aeb..96a3f86d8e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -412,6 +412,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"
diff --git a/khash.h b/khash.h
index d10caa0c35..532109c87f 100644
--- a/khash.h
+++ b/khash.h
@@ -234,7 +234,7 @@ static const double __ac_HASH_UPPER = 0.77;
__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
- KHASH_INIT2(name, static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
+ KHASH_INIT2(name, MAYBE_UNUSED static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
/* Other convenient macros... */