Stop #include-ing wcstringutil.h in flog.h

This is a header dependency that we can break.
This commit is contained in:
ridiculousfish 2020-07-29 16:37:23 -07:00
parent db086fc5d4
commit c9b42c6f1f
8 changed files with 18 additions and 3 deletions

View file

@ -33,6 +33,7 @@
#include "proc.h"
#include "reader.h"
#include "termsize.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
/// Some configuration path environment variables.

View file

@ -48,6 +48,7 @@
#include "signal.h"
#include "timer.h"
#include "trace.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
/// Number of calls to fork() or posix_spawn().

View file

@ -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(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, ...) {
va_list va;
va_start(va, fmt);

View file

@ -11,7 +11,6 @@
#include <utility>
#include "global_safety.h"
#include "wcstringutil.h"
using wcstring = std::wstring;
using wcstring_list_t = std::vector<wcstring>;
@ -115,14 +114,20 @@ class logger_t {
void log1(const char *);
void log1(wchar_t);
void log1(char);
void log1(int64_t);
void log1(uint64_t);
void log1(const wcstring &s) { log1(s.c_str()); }
void log1(const std::string &s) { log1(s.c_str()); }
template <typename T,
typename Enabler = typename std::enable_if<std::is_integral<T>::value>::type>
void log1(const T &v) {
log1(to_string(v));
void log1(T v) {
if (std::is_signed<T>::value) {
log1(static_cast<int64_t>(v));
} else {
log1(static_cast<uint64_t>(v));
}
}
template <typename T>

View file

@ -21,6 +21,7 @@
#include "expand.h"
#include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
/// Unexpected error in path_get_path().

View file

@ -51,6 +51,7 @@
#include "reader.h"
#include "sanity.h"
#include "signal.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
/// The signals that signify crashes to us.

View file

@ -4,6 +4,7 @@
#include "maybe.h"
#include "parser.h"
#include "wcstringutil.h"
#include "wutil.h"
// A counter which is incremented every SIGWINCH, or when the tty is otherwise invalidated.

View file

@ -29,6 +29,7 @@
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "wcstringutil.h"
#include "wutil.h" // IWYU pragma: keep
using cstring = std::string;