mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-04 17:18:45 +00:00
14d2a6d8ff
Let's hope this doesn't causes build failures for e.g. musl: I just know it's good on macOS and our Linux CI. It's been a long time. One fix this brings, is I discovered we #include assert.h or cassert in a lot of places. If those ever happen to be in a file that doesn't include common.h, or we are before common.h gets included, we're unawaringly working with the system 'assert' macro again, which may get disabled for debug builds or at least has different behavior on crash. We undef 'assert' and redefine it in common.h. Those were all eliminated, except in one catch-22 spot for maybe.h: it can't include common.h. A fix might be to make a fish_assert.h that *usually* common.h exports.
25 lines
746 B
C++
25 lines
746 B
C++
/// Support for fish_trace.
|
|
#ifndef FISH_TRACE_H
|
|
#define FISH_TRACE_H
|
|
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include "common.h"
|
|
|
|
class parser_t;
|
|
|
|
/// Trace an "argv": a list of arguments. Each argument is escaped.
|
|
/// If \p command is not null, it is traced first (and not escaped)
|
|
void trace_argv(const parser_t &parser, const wchar_t *command, const wcstring_list_t &argv);
|
|
|
|
/// \return whether tracing is enabled.
|
|
bool trace_enabled(const parser_t &parser);
|
|
|
|
/// Enable or disable tracing.
|
|
void trace_set_enabled(bool do_enable);
|
|
|
|
/// Convenience helper to trace a single string if tracing is enabled.
|
|
void trace_if_enabled(const parser_t &parser, const wchar_t *command,
|
|
const wcstring_list_t &argv = {});
|
|
|
|
#endif
|