mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
fmt rename to fmt_ to avoid naming conflict with the spdlog library
This commit is contained in:
parent
db927c5159
commit
f438284a47
|
@ -16571,25 +16571,25 @@ namespace sol {
|
|||
|
||||
struct error_result {
|
||||
int results;
|
||||
const char* fmt;
|
||||
const char* fmt_;
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
inline int handle_errors(lua_State* L, const error_result& er) {
|
||||
if (er.fmt == nullptr) {
|
||||
if (er.fmt_ == nullptr) {
|
||||
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>
|
||||
|
|
|
@ -456,25 +456,25 @@ namespace sol {
|
|||
|
||||
struct error_result {
|
||||
int results;
|
||||
const char* fmt;
|
||||
const char* fmt_;
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
inline int handle_errors(lua_State* L, const error_result& er) {
|
||||
if (er.fmt == nullptr) {
|
||||
if (er.fmt_ == nullptr) {
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user