Silly macro removed-2
This commit is contained in:
+20
-7
@@ -1,11 +1,16 @@
|
||||
#include "StrFmt.h"
|
||||
#include "BEType.h"
|
||||
#include "StrUtil.h"
|
||||
#include "Macro.h"
|
||||
#include "cfmt.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
void fmt_class_string<const void*>::format(std::string& out, u64 arg)
|
||||
{
|
||||
fmt::append(out, "%p", reinterpret_cast<const void*>(static_cast<std::uintptr_t>(arg)));
|
||||
@@ -124,18 +129,26 @@ namespace fmt
|
||||
{
|
||||
void raw_error(const char* msg)
|
||||
{
|
||||
std::string out{"Error"};
|
||||
|
||||
out += ": ";
|
||||
out += msg;
|
||||
|
||||
throw std::runtime_error{out};
|
||||
throw std::runtime_error{msg};
|
||||
}
|
||||
|
||||
void raw_verify_error(const char* msg, uint position)
|
||||
{
|
||||
std::string out{"Verification failed"};
|
||||
|
||||
// Print error code (may be irrelevant)
|
||||
#ifdef _WIN32
|
||||
if (DWORD error = GetLastError())
|
||||
{
|
||||
fmt::append(out, " (e%#x)", error);
|
||||
}
|
||||
#else
|
||||
if (int error = errno)
|
||||
{
|
||||
fmt::append(out, " (e%d)", error);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (position)
|
||||
{
|
||||
out += " (+";
|
||||
|
||||
Reference in New Issue
Block a user