Skip to content

Commit b4b85e4

Browse files
Eric Wonggitster
authored andcommitted
sha256/gcrypt: fix build with SANITIZE=leak
Non-static functions cause `undefined reference' errors when building with `SANITIZE=leak' due to the lack of prototypes. Mark all these functions as `static inline' as we do in sha256/nettle.h to avoid the need to maintain prototypes. Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fb7d80e commit b4b85e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sha256/gcrypt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77

88
typedef gcry_md_hd_t gcrypt_SHA256_CTX;
99

10-
inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
10+
static inline void gcrypt_SHA256_Init(gcrypt_SHA256_CTX *ctx)
1111
{
1212
gcry_md_open(ctx, GCRY_MD_SHA256, 0);
1313
}
1414

15-
inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
15+
static inline void gcrypt_SHA256_Update(gcrypt_SHA256_CTX *ctx, const void *data, size_t len)
1616
{
1717
gcry_md_write(*ctx, data, len);
1818
}
1919

20-
inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
20+
static inline void gcrypt_SHA256_Final(unsigned char *digest, gcrypt_SHA256_CTX *ctx)
2121
{
2222
memcpy(digest, gcry_md_read(*ctx, GCRY_MD_SHA256), SHA256_DIGEST_SIZE);
2323
}
2424

25-
inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
25+
static inline void gcrypt_SHA256_Clone(gcrypt_SHA256_CTX *dst, const gcrypt_SHA256_CTX *src)
2626
{
2727
gcry_md_copy(dst, *src);
2828
}

0 commit comments

Comments
 (0)