Skip to content

Commit d78a1b1

Browse files
authored
Merge pull request libgit2#5174 from pks-t/pks/winhttp-hash
sha1: fix compilation of WinHTTP backend
2 parents 964c1c6 + 270fd80 commit d78a1b1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- template: azure-pipelines/powershell.yml
9191
parameters:
9292
environmentVariables:
93-
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON
93+
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
9494

9595
- job: windows_mingw_amd64
9696
displayName: 'Windows (amd64; MinGW)'

azure-pipelines/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- template: powershell.yml
9393
parameters:
9494
environmentVariables:
95-
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON
95+
CMAKE_OPTIONS: -DMSVC_CRTDBG=ON -G"Visual Studio 12 2013" -DDEPRECATE_HARD=ON -DUSE_SHA1=HTTPS
9696
RUN_INVASIVE_TESTS: true
9797

9898
- job: windows_mingw_amd64

cmake/Modules/SelectHashes.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ IF(SHA1_BACKEND STREQUAL "CollisionDetection")
3030
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
3131
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
3232
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
33-
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.c hash/sha1/sha1dc/*)
33+
FILE(GLOB SRC_SHA1 hash/sha1/collisiondetect.* hash/sha1/sha1dc/*)
3434
ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
3535
# OPENSSL_FOUND should already be set, we're checking HTTPS_BACKEND
3636

@@ -40,13 +40,13 @@ ELSEIF(SHA1_BACKEND STREQUAL "OpenSSL")
4040
ELSE()
4141
LIST(APPEND LIBGIT2_PC_REQUIRES "openssl")
4242
ENDIF()
43-
FILE(GLOB SRC_SHA1 hash/sha1/openssl.c)
43+
FILE(GLOB SRC_SHA1 hash/sha1/openssl.*)
4444
ELSEIF(SHA1_BACKEND STREQUAL "CommonCrypto")
4545
SET(GIT_SHA1_COMMON_CRYPTO 1)
46-
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.c)
46+
FILE(GLOB SRC_SHA1 hash/sha1/common_crypto.*)
4747
ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
4848
SET(GIT_SHA1_MBEDTLS 1)
49-
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.c)
49+
FILE(GLOB SRC_SHA1 hash/sha1/mbedtls.*)
5050
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${MBEDTLS_INCLUDE_DIR})
5151
LIST(APPEND LIBGIT2_LIBS ${MBEDTLS_LIBRARIES})
5252
# mbedTLS has no pkgconfig file, hence we can't require it
@@ -55,9 +55,9 @@ ELSEIF(SHA1_BACKEND STREQUAL "mbedTLS")
5555
LIST(APPEND LIBGIT2_PC_LIBS ${MBEDTLS_LIBRARIES})
5656
ELSEIF(SHA1_BACKEND STREQUAL "Win32")
5757
SET(GIT_SHA1_WIN32 1)
58-
FILE(GLOB SRC_SHA1 hash/sha1/win32.c)
58+
FILE(GLOB SRC_SHA1 hash/sha1/win32.*)
5959
ELSEIF(SHA1_BACKEND STREQUAL "Generic")
60-
FILE(GLOB SRC_SHA1 hash/sha1/generic.c)
60+
FILE(GLOB SRC_SHA1 hash/sha1/generic.*)
6161
# ELSEIF(NOT USE_SHA1)
6262
ELSE()
6363
MESSAGE(FATAL_ERROR "Asked for unknown SHA1 backend: ${SHA1_BACKEND}")

src/hash/sha1/win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/* BCRYPT_HASH_REUSEABLE_FLAGS */
2424
#define GIT_HASH_CNG_HASH_REUSABLE 0x00000020
2525

26-
static struct git_hash_prov hash_prov = {0};
26+
static git_hash_prov hash_prov = {0};
2727

2828
/* Hash initialization */
2929

0 commit comments

Comments
 (0)