Commit f7b54ca4 authored by Kirill Smelkov's avatar Kirill Smelkov

X avoid fmt::vsprintf (now compils again with latest pygolang@master)

parent d994f5f3
......@@ -224,6 +224,8 @@ tuple<uint64_t, error> parseUint(const string& s) {
// xerr::
namespace xerr {
// XXX don't require fmt::vsprintf
#if 0
Contextf::Contextf(const char *format, ...) {
Contextf& c = *this;
......@@ -232,6 +234,7 @@ Contextf::Contextf(const char *format, ...) {
c.errctx = fmt::vsprintf(format, argp);
va_end(argp);
}
#endif
error Contextf::operator() (error err) const {
const Contextf& c = *this;
......
......@@ -146,6 +146,8 @@ typedef uint64_t Oid;
} // zodb::
#include <golang/fmt.h>
// xerr::
namespace xerr {
......@@ -164,11 +166,16 @@ class Contextf {
string errctx;
public:
Contextf(const char *format, ...);
template<typename ...Argv>
inline Contextf(const char *format, Argv... argv) {
// XXX string() to avoid "error: format not a string literal" given by -Werror=format-security
errctx = fmt::sprintf(string(format), argv...);
}
error operator() (error) const;
};
}
} // xerr::
// wcfs::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment