Commit 8507bf81 by Edward Thomson

trace: always enabled

There's no need to make tracing opt-in; it should always be included.
parent 780faa41
...@@ -41,7 +41,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON) ...@@ -41,7 +41,6 @@ OPTION(THREADSAFE "Build libgit2 as threadsafe" ON)
OPTION(BUILD_TESTS "Build Tests using the Clar suite" ON) OPTION(BUILD_TESTS "Build Tests using the Clar suite" ON)
OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF) OPTION(BUILD_EXAMPLES "Build library usage example apps" OFF)
OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF) OPTION(BUILD_FUZZERS "Build the fuzz targets" OFF)
OPTION(ENABLE_TRACE "Enables tracing support" ON)
OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF) OPTION(LIBGIT2_FILENAME "Name of the produced binary" OFF)
OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON) OPTION(USE_SSH "Link with libssh2 to enable SSH support" ON)
OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON) OPTION(USE_HTTPS "Enable HTTPS support. Can be set to a specific backend" ON)
......
...@@ -37,12 +37,6 @@ SET(LIBGIT2_LIBS "") ...@@ -37,12 +37,6 @@ SET(LIBGIT2_LIBS "")
enable_warnings(missing-declarations) enable_warnings(missing-declarations)
# Enable tracing
IF(ENABLE_TRACE)
SET(GIT_TRACE 1)
ENDIF()
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
IF (HAVE_FUTIMENS) IF (HAVE_FUTIMENS)
SET(GIT_USE_FUTIMENS 1) SET(GIT_USE_FUTIMENS 1)
ENDIF () ENDIF ()
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#cmakedefine GIT_DEBUG_STRICT_ALLOC 1 #cmakedefine GIT_DEBUG_STRICT_ALLOC 1
#cmakedefine GIT_DEBUG_STRICT_OPEN 1 #cmakedefine GIT_DEBUG_STRICT_OPEN 1
#cmakedefine GIT_TRACE 1
#cmakedefine GIT_THREADS 1 #cmakedefine GIT_THREADS 1
#cmakedefine GIT_WIN32_LEAKCHECK 1 #cmakedefine GIT_WIN32_LEAKCHECK 1
......
...@@ -11,15 +11,10 @@ ...@@ -11,15 +11,10 @@
#include "runtime.h" #include "runtime.h"
#include "git2/trace.h" #include "git2/trace.h"
#ifdef GIT_TRACE
struct git_trace_data git_trace__data = {0}; struct git_trace_data git_trace__data = {0};
#endif
int git_trace_set(git_trace_level_t level, git_trace_cb callback) int git_trace_set(git_trace_level_t level, git_trace_cb callback)
{ {
#ifdef GIT_TRACE
GIT_ASSERT_ARG(level == 0 || callback != NULL); GIT_ASSERT_ARG(level == 0 || callback != NULL);
git_trace__data.level = level; git_trace__data.level = level;
...@@ -27,12 +22,4 @@ int git_trace_set(git_trace_level_t level, git_trace_cb callback) ...@@ -27,12 +22,4 @@ int git_trace_set(git_trace_level_t level, git_trace_cb callback)
GIT_MEMORY_BARRIER; GIT_MEMORY_BARRIER;
return 0; return 0;
#else
GIT_UNUSED(level);
GIT_UNUSED(callback);
git_error_set(GIT_ERROR_INVALID,
"this version of libgit2 was not built with tracing.");
return -1;
#endif
} }
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
#include <git2/trace.h> #include <git2/trace.h>
#include "str.h" #include "str.h"
#ifdef GIT_TRACE
struct git_trace_data { struct git_trace_data {
git_trace_level_t level; git_trace_level_t level;
git_trace_cb callback; git_trace_cb callback;
...@@ -50,19 +48,4 @@ GIT_INLINE(void) git_trace(git_trace_level_t level, const char *fmt, ...) ...@@ -50,19 +48,4 @@ GIT_INLINE(void) git_trace(git_trace_level_t level, const char *fmt, ...)
} }
} }
#else
GIT_INLINE(void) git_trace__null(
git_trace_level_t level,
const char *fmt, ...)
{
GIT_UNUSED(level);
GIT_UNUSED(fmt);
}
#define git_trace_level() ((git_trace_level_t)0)
#define git_trace git_trace__null
#endif
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment