mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
Stop #include-ing wcstringutil.h in flog.h
This is a header dependency that we can break.
This commit is contained in:
parent
db086fc5d4
commit
c9b42c6f1f
8 changed files with 18 additions and 3 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "termsize.h"
|
#include "termsize.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
/// Some configuration path environment variables.
|
/// Some configuration path environment variables.
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "signal.h"
|
#include "signal.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
/// Number of calls to fork() or posix_spawn().
|
/// Number of calls to fork() or posix_spawn().
|
||||||
|
|
|
@ -46,6 +46,10 @@ void logger_t::log1(wchar_t c) { std::fputwc(c, file_); }
|
||||||
|
|
||||||
void logger_t::log1(char c) { std::fwprintf(file_, L"%c", c); }
|
void logger_t::log1(char c) { std::fwprintf(file_, L"%c", c); }
|
||||||
|
|
||||||
|
void logger_t::log1(int64_t v) { std::fwprintf(file_, L"%lld", v); }
|
||||||
|
|
||||||
|
void logger_t::log1(uint64_t v) { std::fwprintf(file_, L"%llu", v); }
|
||||||
|
|
||||||
void logger_t::log_fmt(const category_t &cat, const wchar_t *fmt, ...) {
|
void logger_t::log_fmt(const category_t &cat, const wchar_t *fmt, ...) {
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
|
|
11
src/flog.h
11
src/flog.h
|
@ -11,7 +11,6 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "global_safety.h"
|
#include "global_safety.h"
|
||||||
#include "wcstringutil.h"
|
|
||||||
|
|
||||||
using wcstring = std::wstring;
|
using wcstring = std::wstring;
|
||||||
using wcstring_list_t = std::vector<wcstring>;
|
using wcstring_list_t = std::vector<wcstring>;
|
||||||
|
@ -115,14 +114,20 @@ class logger_t {
|
||||||
void log1(const char *);
|
void log1(const char *);
|
||||||
void log1(wchar_t);
|
void log1(wchar_t);
|
||||||
void log1(char);
|
void log1(char);
|
||||||
|
void log1(int64_t);
|
||||||
|
void log1(uint64_t);
|
||||||
|
|
||||||
void log1(const wcstring &s) { log1(s.c_str()); }
|
void log1(const wcstring &s) { log1(s.c_str()); }
|
||||||
void log1(const std::string &s) { log1(s.c_str()); }
|
void log1(const std::string &s) { log1(s.c_str()); }
|
||||||
|
|
||||||
template <typename T,
|
template <typename T,
|
||||||
typename Enabler = typename std::enable_if<std::is_integral<T>::value>::type>
|
typename Enabler = typename std::enable_if<std::is_integral<T>::value>::type>
|
||||||
void log1(const T &v) {
|
void log1(T v) {
|
||||||
log1(to_string(v));
|
if (std::is_signed<T>::value) {
|
||||||
|
log1(static_cast<int64_t>(v));
|
||||||
|
} else {
|
||||||
|
log1(static_cast<uint64_t>(v));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "expand.h"
|
#include "expand.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
/// Unexpected error in path_get_path().
|
/// Unexpected error in path_get_path().
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "sanity.h"
|
#include "sanity.h"
|
||||||
#include "signal.h"
|
#include "signal.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
/// The signals that signify crashes to us.
|
/// The signals that signify crashes to us.
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "maybe.h"
|
#include "maybe.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h"
|
#include "wutil.h"
|
||||||
|
|
||||||
// A counter which is incremented every SIGWINCH, or when the tty is otherwise invalidated.
|
// A counter which is incremented every SIGWINCH, or when the tty is otherwise invalidated.
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
|
#include "wcstringutil.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
using cstring = std::string;
|
using cstring = std::string;
|
||||||
|
|
Loading…
Reference in a new issue