Skip to content

Commit c951b82

Browse files
committed
deprecation: define GIT_DEPRECATE_HARD internally
Ensure that we do not use any deprecated functions in the library source, test code or examples.
1 parent 9f3a5a6 commit c951b82

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${
105105
FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION [0-9]+$")
106106
STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")
107107

108+
# Ensure that we do not use deprecated functions internally
109+
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
110+
108111
# Platform specific compilation flags
109112
IF (MSVC)
110113
IF (STDCALL)
@@ -229,7 +232,6 @@ ELSE ()
229232
ENABLE_WARNINGS(int-conversion)
230233
DISABLE_WARNINGS(documentation-deprecated-sync)
231234

232-
233235
IF (PROFILE)
234236
SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
235237
SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}")

tests/stream/deprecated.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#undef GIT_DEPRECATE_HARD
2+
13
#include "clar_libgit2.h"
24
#include "git2/sys/stream.h"
35
#include "streams/tls.h"

0 commit comments

Comments
 (0)