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) { ...@@ -224,6 +224,8 @@ tuple<uint64_t, error> parseUint(const string& s) {
// xerr:: // xerr::
namespace xerr { namespace xerr {
// XXX don't require fmt::vsprintf
#if 0
Contextf::Contextf(const char *format, ...) { Contextf::Contextf(const char *format, ...) {
Contextf& c = *this; Contextf& c = *this;
...@@ -232,6 +234,7 @@ Contextf::Contextf(const char *format, ...) { ...@@ -232,6 +234,7 @@ Contextf::Contextf(const char *format, ...) {
c.errctx = fmt::vsprintf(format, argp); c.errctx = fmt::vsprintf(format, argp);
va_end(argp); va_end(argp);
} }
#endif
error Contextf::operator() (error err) const { error Contextf::operator() (error err) const {
const Contextf& c = *this; const Contextf& c = *this;
......
...@@ -146,6 +146,8 @@ typedef uint64_t Oid; ...@@ -146,6 +146,8 @@ typedef uint64_t Oid;
} // zodb:: } // zodb::
#include <golang/fmt.h>
// xerr:: // xerr::
namespace xerr { namespace xerr {
...@@ -164,11 +166,16 @@ class Contextf { ...@@ -164,11 +166,16 @@ class Contextf {
string errctx; string errctx;
public: 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; error operator() (error) const;
}; };
} } // xerr::
// wcfs:: // 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