Skip to content

Commit

Permalink
deprecation: define GIT_DEPRECATE_HARD internally
Browse files Browse the repository at this point in the history
Ensure that we do not use any deprecated functions in the library
source, test code or examples.
  • Loading branch information
ethomson committed Jan 25, 2019
1 parent 9f3a5a6 commit c951b82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ SET(LIBGIT2_VERSION_STRING "${LIBGIT2_VERSION_MAJOR}.${LIBGIT2_VERSION_MINOR}.${
FILE(STRINGS "${libgit2_SOURCE_DIR}/include/git2/version.h" GIT2_HEADER_SOVERSION REGEX "^#define LIBGIT2_SOVERSION [0-9]+$")
STRING(REGEX REPLACE "^.*LIBGIT2_SOVERSION ([0-9]+)$" "\\1" LIBGIT2_SOVERSION "${GIT2_HEADER_SOVERSION}")

# Ensure that we do not use deprecated functions internally
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)

# Platform specific compilation flags
IF (MSVC)
IF (STDCALL)
Expand Down Expand Up @@ -229,7 +232,6 @@ ELSE ()
ENABLE_WARNINGS(int-conversion)
DISABLE_WARNINGS(documentation-deprecated-sync)


IF (PROFILE)
SET(CMAKE_C_FLAGS "-pg ${CMAKE_C_FLAGS}")
SET(CMAKE_EXE_LINKER_FLAGS "-pg ${CMAKE_EXE_LINKER_FLAGS}")
Expand Down
2 changes: 2 additions & 0 deletions tests/stream/deprecated.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#undef GIT_DEPRECATE_HARD

#include "clar_libgit2.h"
#include "git2/sys/stream.h"
#include "streams/tls.h"
Expand Down

0 comments on commit c951b82

Please sign in to comment.