Don't use short version of 'tinyformat/fmt' namespace in util.h (#1975)

* Don't use short version of 'tinyformat/fmt' namespace in util.h

Clion is not able to parse this correctly and messes up all the syntax
checks, marking large parts of C++ files as syntactically invalid, making
it hard to find real syntax errors without trying compilation.

* Also use full namespace name for strprintf in tinyformat.h
This commit is contained in:
Alexander Block 2018-03-08 13:18:51 +01:00 committed by UdjinM6
parent 97a07cbc4c
commit 3200eae9b1
2 changed files with 4 additions and 4 deletions

View File

@ -1044,6 +1044,6 @@ std::string format(const std::string &fmt, const Args&... args)
} // namespace tinyformat
#define strprintf tfm::format
#define strprintf tinyformat::format
#endif // TINYFORMAT_H_INCLUDED

View File

@ -96,18 +96,18 @@ int LogPrintStr(const std::string &str);
#define LogPrint(category, ...) do { \
if (LogAcceptCategory((category))) { \
LogPrintStr(tfm::format(__VA_ARGS__)); \
LogPrintStr(tinyformat::format(__VA_ARGS__)); \
} \
} while(0)
#define LogPrintf(...) do { \
LogPrintStr(tfm::format(__VA_ARGS__)); \
LogPrintStr(tinyformat::format(__VA_ARGS__)); \
} while(0)
template<typename... Args>
bool error(const char* fmt, const Args&... args)
{
LogPrintStr("ERROR: " + tfm::format(fmt, args...) + "\n");
LogPrintStr("ERROR: " + tinyformat::format(fmt, args...) + "\n");
return false;
}