mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-16 07:07:13 +02:00
Lazy fix for new changes to cpp fmt library.
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
#include <fmt/args.h>
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/locale.h>
|
||||
#include <fmt/xchar.h>
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
namespace SqMod {
|
||||
|
@ -329,7 +329,7 @@ LightObj GetEntryAsString(const MMDB_entry_data_s & ed)
|
||||
switch (ed.type)
|
||||
{
|
||||
case MMDB_DATA_TYPE_POINTER: {
|
||||
sq_pushstring(vm, fmt::format("{:p}", ed.pointer).c_str(), -1);
|
||||
sq_pushstring(vm, fmt::format(fmt::runtime("{:p}"), ed.pointer).c_str(), -1);
|
||||
} break;
|
||||
case MMDB_DATA_TYPE_UTF8_STRING: {
|
||||
sq_pushstring(vm, ed.utf8_string, ed.data_size);
|
||||
@ -452,7 +452,7 @@ void SockAddr::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid sockaddr structure handle");
|
||||
SqThrowF(fmt::runtime("Invalid sockaddr structure handle"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -559,7 +559,7 @@ void Database::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -695,7 +695,7 @@ void Description::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -720,7 +720,7 @@ Description::Pointer Description::GetValid() const
|
||||
// Validate the referenced description
|
||||
if (!m_Description)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind meta-data description reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind meta-data description reference"));
|
||||
}
|
||||
// Return the description pointer
|
||||
return m_Description;
|
||||
@ -755,7 +755,7 @@ void EntryData::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -780,7 +780,7 @@ EntryData::ConstRef EntryData::GetValid() const
|
||||
// See if the entry has any data
|
||||
if (!m_Entry.has_data)
|
||||
{
|
||||
SqThrowF("The referenced entry has no data");
|
||||
SqThrowF(fmt::runtime("The referenced entry has no data"));
|
||||
}
|
||||
// Return the entry
|
||||
return m_Entry;
|
||||
@ -829,7 +829,7 @@ void EntryDataList::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -854,7 +854,7 @@ EntryDataList::Pointer EntryDataList::GetValid() const
|
||||
// Validate the managed list
|
||||
if (!m_List)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind entry data list reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind entry data list reference"));
|
||||
}
|
||||
// return the list
|
||||
return m_List;
|
||||
@ -881,7 +881,7 @@ EntryDataList::Pointer EntryDataList::GetValidElem() const
|
||||
// Validate the current element
|
||||
if (!m_List)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind entry data element reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind entry data element reference"));
|
||||
}
|
||||
// return the element
|
||||
return m_Elem;
|
||||
@ -987,7 +987,7 @@ void LookupResult::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1147,7 +1147,7 @@ void Metadata::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1172,7 +1172,7 @@ Metadata::Pointer Metadata::GetValid() const
|
||||
// Validate the referenced meta-data
|
||||
if (!m_Metadata)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind meta-data reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind meta-data reference"));
|
||||
}
|
||||
// Return the meta-data pointer
|
||||
return m_Metadata;
|
||||
@ -1219,7 +1219,7 @@ void SearchNode::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid Maxmind database reference");
|
||||
SqThrowF(fmt::runtime("Invalid Maxmind database reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
@ -1631,7 +1631,7 @@ void Connection::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL connection reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL connection reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1654,11 +1654,11 @@ void Connection::ValidateCreated() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL connection reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL connection reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid MySQL connection");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL connection"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1976,12 +1976,12 @@ void Field::Validate() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
// Are we pointing to a valid index?
|
||||
else if (m_Index >= m_Handle->mFieldCount)
|
||||
{
|
||||
SqThrowF("Field index is out of range: {} >= {}", m_Index, m_Handle->mFieldCount);
|
||||
SqThrowF(fmt::runtime("Field index is out of range: {} >= {}"), m_Index, m_Handle->mFieldCount);
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2004,7 +2004,7 @@ void Field::ValidateCreated() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
// Are we pointing to a valid index?
|
||||
m_Handle->ValidateField(m_Index);
|
||||
@ -2034,12 +2034,12 @@ void Field::ValidateStepped() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
// Do we have a valid row available?
|
||||
else if (m_Handle->mRow == nullptr)
|
||||
{
|
||||
SqThrowF("No row available in MySQL result-set");
|
||||
SqThrowF(fmt::runtime("No row available in MySQL result-set"));
|
||||
}
|
||||
// Are we pointing to a valid index?
|
||||
m_Handle->ValidateField(m_Index);
|
||||
@ -2109,7 +2109,7 @@ void Field::ValidateField(uint32_t idx) const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
// Validate the specified field index
|
||||
m_Handle->ValidateField(idx);
|
||||
@ -2480,7 +2480,7 @@ void ResultSet::Validate() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2505,11 +2505,11 @@ void ResultSet::ValidateCreated() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2535,12 +2535,12 @@ void ResultSet::ValidateStepped() const
|
||||
// Do we have a valid result-set handle?
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL result-set reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL result-set reference"));
|
||||
}
|
||||
// Do we have a valid row available?
|
||||
else if (m_Handle->mRow == nullptr)
|
||||
{
|
||||
SqThrowF("No row available in MySQL result-set");
|
||||
SqThrowF(fmt::runtime("No row available in MySQL result-set"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2761,7 +2761,7 @@ void Statement::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL statement reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2784,11 +2784,11 @@ void Statement::ValidateCreated() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid MySQL statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL statement reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid MySQL statement");
|
||||
SqThrowF(fmt::runtime("Invalid MySQL statement"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
@ -903,7 +903,7 @@ void SQLiteConnection::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite connection reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite connection reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -926,11 +926,11 @@ void SQLiteConnection::ValidateCreated() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite connection reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite connection reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid SQLite connection");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite connection"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1241,12 +1241,12 @@ void SQLiteParameter::Validate() const
|
||||
// Are we pointing to a valid index?
|
||||
if (m_Index < 0)
|
||||
{
|
||||
SqThrowF("Invalid column index: {} < 0", m_Index);
|
||||
SqThrowF(fmt::runtime("Invalid column index: {} < 0"), m_Index);
|
||||
}
|
||||
// Do we have a valid statement handle?
|
||||
else if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1275,15 +1275,15 @@ void SQLiteParameter::ValidateCreated() const
|
||||
// Are we pointing to a valid index?
|
||||
if (m_Index < 0)
|
||||
{
|
||||
SqThrowF("Invalid column index: {} < 0", m_Index);
|
||||
SqThrowF(fmt::runtime("Invalid column index: {} < 0"), m_Index);
|
||||
}
|
||||
else if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1337,7 +1337,7 @@ void SQLiteParameter::ValidateParam(int32_t idx) const
|
||||
// Is the specified index in range?
|
||||
if (!m_Handle->CheckParameter(idx))
|
||||
{
|
||||
SqThrowF("SQLiteParameter index is out of range ({}:{})", idx, m_Handle->mParameters);
|
||||
SqThrowF(fmt::runtime("SQLiteParameter index is out of range ({}:{})"), idx, m_Handle->mParameters);
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1947,12 +1947,12 @@ void SQLiteColumn::Validate() const
|
||||
// Are we pointing to a valid index?
|
||||
if (m_Index < 0)
|
||||
{
|
||||
SqThrowF("Invalid column index: {} < 0", m_Index);
|
||||
SqThrowF(fmt::runtime("Invalid column index: {} < 0"), m_Index);
|
||||
}
|
||||
// Do we have a valid statement handle?
|
||||
else if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -1981,15 +1981,15 @@ void SQLiteColumn::ValidateCreated() const
|
||||
// Are we pointing to a valid index?
|
||||
if (m_Index < 0)
|
||||
{
|
||||
SqThrowF("Invalid column index: {} < 0", m_Index);
|
||||
SqThrowF(fmt::runtime("Invalid column index: {} < 0"), m_Index);
|
||||
}
|
||||
else if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2043,7 +2043,7 @@ void SQLiteColumn::ValidateColumn(int32_t idx) const
|
||||
// Is the specified index in range?
|
||||
if (!m_Handle->CheckColumn(idx))
|
||||
{
|
||||
SqThrowF("Column index is out of range: {}:{}", idx, m_Handle->mColumns);
|
||||
SqThrowF(fmt::runtime("Column index is out of range: {}:{}"), idx, m_Handle->mColumns);
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2415,7 +2415,7 @@ void SQLiteStatement::Validate() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2438,11 +2438,11 @@ void SQLiteStatement::ValidateCreated() const
|
||||
{
|
||||
if (!m_Handle)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement reference");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement reference"));
|
||||
}
|
||||
else if (m_Handle->mPtr == nullptr)
|
||||
{
|
||||
SqThrowF("Invalid SQLite statement");
|
||||
SqThrowF(fmt::runtime("Invalid SQLite statement"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2495,7 +2495,7 @@ void SQLiteStatement::ValidateColumn(int32_t idx) const
|
||||
// Is the specified index in range?
|
||||
if (!m_Handle->CheckColumn(idx))
|
||||
{
|
||||
SqThrowF("Column index is out of range: {}:{}", idx, m_Handle->mColumns);
|
||||
SqThrowF(fmt::runtime("Column index is out of range: {}:{}"), idx, m_Handle->mColumns);
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2518,7 +2518,7 @@ void SQLiteStatement::ValidateParam(int32_t idx) const
|
||||
// Is the specified index in range?
|
||||
if (!m_Handle->CheckParameter(idx))
|
||||
{
|
||||
SqThrowF("Parameter index is out of range: {}:{}", idx, m_Handle->mParameters);
|
||||
SqThrowF(fmt::runtime("Parameter index is out of range: {}:{}"), idx, m_Handle->mParameters);
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@ -2541,7 +2541,7 @@ void SQLiteStatement::ValidateRow() const
|
||||
// Do we have any rows available?
|
||||
if (!m_Handle->mGood)
|
||||
{
|
||||
SqThrowF("No row available");
|
||||
SqThrowF(fmt::runtime("No row available"));
|
||||
}
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
Reference in New Issue
Block a user