Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c/tskit/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ FILE *
tsk_get_debug_stream(void)
{
if (_tsk_debug_stream == NULL) {
_tsk_debug_stream = stdout;
_tsk_debug_stream = TSK_DEFAULT_DEBUG_STREAM;
}
return _tsk_debug_stream;
}
Expand Down
18 changes: 17 additions & 1 deletion c/tskit/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ disallowed (use compute_mutation_times?).
*/
#define TSK_ERR_DISALLOWED_UNKNOWN_MUTATION_TIME -510

/**
/**
A mutation's parent was not consistent with the topology of the tree.
*/
#define TSK_ERR_BAD_MUTATION_PARENT -511
Expand Down Expand Up @@ -971,6 +971,12 @@ not be freed by client code.
*/
const char *tsk_strerror(int err);

/* Redefine this macro in downstream builds if stdout is not the
* approriate stream to emit debug information when the TSK_DEBUG
* flag is passed to supporting functions (e.g. in R).
*/
#define TSK_DEFAULT_DEBUG_STREAM stdout

#ifdef TSK_TRACE_ERRORS

static inline int
Expand All @@ -981,6 +987,11 @@ _tsk_trace_error(int err, int line, const char *file)
return err;
}

/*
Developer note: this macro may be redefined as part of compilation for
an R package, and should be treated as part of the documented API
(no changes).
*/
#define tsk_trace_error(err) (_tsk_trace_error(err, __LINE__, __FILE__))
#else
#define tsk_trace_error(err) (err)
Expand All @@ -1001,6 +1012,11 @@ means compiling without NDEBUG. This macro still asserts when NDEBUG is defined.
If you are using this macro in your own software then please set TSK_BUG_ASSERT_MESSAGE
to point users to your issue tracker.
*/
/*
Developer note: this macro may redefined as part of compilation for
an R package, and should be treated as part of the documented API
(no changes).
*/
#define tsk_bug_assert(condition) \
do { \
if (!(condition)) { \
Expand Down