fmt rename to fmt_ to avoid naming conflict with the spdlog library

This commit is contained in:
isvogor 2018-09-03 15:36:37 +02:00
parent db927c5159
commit f438284a47
2 changed files with 53 additions and 53 deletions

View File

@ -16571,25 +16571,25 @@ namespace sol {
struct error_result { struct error_result {
int results; int results;
const char* fmt; const char* fmt_;
std::array<const char*, 4> args; std::array<const char*, 4> args;
error_result() : results(0), fmt(nullptr) { error_result() : results(0), fmt_(nullptr) {
} }
error_result(int results) : results(results), fmt(nullptr) { error_result(int results) : results(results), fmt_(nullptr) {
} }
error_result(const char* fmt, const char* msg) : results(0), fmt(fmt) { error_result(const char* fmt_, const char* msg) : results(0), fmt_(fmt_) {
args[0] = msg; args[0] = msg;
} }
}; };
inline int handle_errors(lua_State* L, const error_result& er) { inline int handle_errors(lua_State* L, const error_result& er) {
if (er.fmt == nullptr) { if (er.fmt_ == nullptr) {
return er.results; return er.results;
} }
return luaL_error(L, er.fmt, er.args[0], er.args[1], er.args[2], er.args[3]); return luaL_error(L, er.fmt_, er.args[0], er.args[1], er.args[2], er.args[3]);
} }
template <typename X, typename = void> template <typename X, typename = void>

View File

@ -456,25 +456,25 @@ namespace sol {
struct error_result { struct error_result {
int results; int results;
const char* fmt; const char* fmt_;
std::array<const char*, 4> args; std::array<const char*, 4> args;
error_result() : results(0), fmt(nullptr) { error_result() : results(0), fmt_(nullptr) {
} }
error_result(int results) : results(results), fmt(nullptr) { error_result(int results) : results(results), fmt_(nullptr) {
} }
error_result(const char* fmt, const char* msg) : results(0), fmt(fmt) { error_result(const char* fmt_, const char* msg) : results(0), fmt_(fmt_) {
args[0] = msg; args[0] = msg;
} }
}; };
inline int handle_errors(lua_State* L, const error_result& er) { inline int handle_errors(lua_State* L, const error_result& er) {
if (er.fmt == nullptr) { if (er.fmt_ == nullptr) {
return er.results; return er.results;
} }
return luaL_error(L, er.fmt, er.args[0], er.args[1], er.args[2], er.args[3]); return luaL_error(L, er.fmt_, er.args[0], er.args[1], er.args[2], er.args[3]);
} }
template <typename X, typename = void> template <typename X, typename = void>