Skip to content

Commit d1622fd

Browse files
committed
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
2 parents da3e075 + d99ea5f commit d1622fd

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

commit-slab-impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#ifndef COMMIT_SLAB_IMPL_H
22
#define COMMIT_SLAB_IMPL_H
33

4-
#define MAYBE_UNUSED __attribute__((__unused__))
4+
#include "git-compat-util.h"
55

66
#define implement_static_commit_slab(slabname, elemtype) \
7-
implement_commit_slab(slabname, elemtype, static MAYBE_UNUSED)
7+
implement_commit_slab(slabname, elemtype, MAYBE_UNUSED static)
88

99
#define implement_shared_commit_slab(slabname, elemtype) \
1010
implement_commit_slab(slabname, elemtype, )

git-compat-util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ static inline char *git_find_last_dir_sep(const char *path)
412412
#define LAST_ARG_MUST_BE_NULL
413413
#endif
414414

415+
#define MAYBE_UNUSED __attribute__((__unused__))
416+
415417
#include "compat/bswap.h"
416418

417419
#include "wildmatch.h"

khash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static const double __ac_HASH_UPPER = 0.77;
234234
__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
235235

236236
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
237-
KHASH_INIT2(name, static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
237+
KHASH_INIT2(name, MAYBE_UNUSED static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
238238

239239
/* Other convenient macros... */
240240

0 commit comments

Comments
 (0)