mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-06 01:58:46 +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.
28 lines
874 B
C++
28 lines
874 B
C++
// Utilities for io redirection.
|
|
#include "config.h" // IWYU pragma: keep
|
|
|
|
#include <utility>
|
|
|
|
#include "operation_context.h"
|
|
#include "env.h"
|
|
|
|
bool no_cancel() { return false; }
|
|
|
|
operation_context_t::operation_context_t(std::shared_ptr<parser_t> parser,
|
|
const environment_t &vars, cancel_checker_t cancel_checker,
|
|
size_t expansion_limit)
|
|
: parser(std::move(parser)),
|
|
vars(vars),
|
|
expansion_limit(expansion_limit),
|
|
cancel_checker(std::move(cancel_checker)) {}
|
|
|
|
operation_context_t operation_context_t::empty() {
|
|
static const null_environment_t nullenv{};
|
|
return operation_context_t{nullenv};
|
|
}
|
|
|
|
operation_context_t operation_context_t::globals() {
|
|
return operation_context_t{env_stack_t::globals()};
|
|
}
|
|
|
|
operation_context_t::~operation_context_t() = default;
|