Skip to content

Commit db1abff

Browse files
committed
sha1dc: do not use standard includes
The updated SHA1DC library allows us to use custom includes instead of using standard includes. Due to requirements with cross-platform, we provide some custom system includes files like for example the "stdint.h" file on Win32. Because of this, we want to make sure to avoid breaking cross-platform compatibility when SHA1DC is enabled. To use the new mechanism, we can simply define `SHA1DC_NO_STANDARD_INCLUDES`. Furthermore, we can specify custom include files via two defines, which we now use to include our "common.h" header.
1 parent 63d86c2 commit db1abff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ ENDIF()
296296
# Specify sha1 implementation
297297
IF (USE_SHA1DC)
298298
ADD_DEFINITIONS(-DGIT_SHA1_COLLISIONDETECT)
299+
ADD_DEFINITIONS(-DSHA1DC_NO_STANDARD_INCLUDES=1)
300+
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\")
301+
ADD_DEFINITIONS(-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\")
299302
FILE(GLOB SRC_SHA1 src/hash/hash_collisiondetect.c src/hash/sha1dc/*)
300303
ELSEIF (WIN32 AND NOT MINGW)
301304
ADD_DEFINITIONS(-DGIT_SHA1_WIN32)

0 commit comments

Comments
 (0)