Commit c951b825bcffdb26140633f657e740e593ea0e80

Edward Thomson 2019-01-23T00:32:40

deprecation: define GIT_DEPRECATE_HARD internally Ensure that we do not use any deprecated functions in the library source, test code or examples.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bc3f07c..eecc22d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
@@ -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}")
diff --git a/tests/stream/deprecated.c b/tests/stream/deprecated.c
index 4fb422e..2c2bbfd 100644
--- a/tests/stream/deprecated.c
+++ b/tests/stream/deprecated.c
@@ -1,3 +1,5 @@
+#undef GIT_DEPRECATE_HARD
+
 #include "clar_libgit2.h"
 #include "git2/sys/stream.h"
 #include "streams/tls.h"