mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
hash: introduce source files to break include circles
The hash source files have circular include dependencies right now, which shows by our broken generic hash implementation. The "hash.h" header declares two functions and the `git_hash_ctx` typedef before actually including the hash backend header and can only declare the remaining hash functions after the include due to possibly static function declarations inside of the implementation includes. Let's break this cycle and help maintainability by creating a real implementation file for each of the hash implementations. Instead of relying on the exact include order, we now especially avoid the use of `GIT_INLINE` for function declarations.
This commit is contained in:
@@ -40,8 +40,10 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
|
||||
ELSE()
|
||||
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
|
||||
ENDIF()
|
||||
FILE(GLOB SRC_SHA1 hash/hash_openssl.c)
|
||||
ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
|
||||
SET(GIT_SHA1_COMMON_CRYPTO 1)
|
||||
FILE(GLOB SRC_SHA1 hash/hash_common_crypto.c)
|
||||
ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
|
||||
SET(GIT_SHA1_MBEDTLS 1)
|
||||
FILE(GLOB SRC_SHA1 hash/hash_mbedtls.c)
|
||||
|
||||
Reference in New Issue
Block a user