Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Exception.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <cerrno>
4
#include <cstring>
5
#include <string>
6
7
namespace
Log
{
8
// Platform-safe strerror wrapper
9
inline
std::string
GetErrnoMessage
()
10
{
11
#ifdef _MSC_VER
12
std::string buffer(256,
'\0'
);
13
strerror_s(buffer.data(), buffer.size(), errno);
14
buffer.resize(std::strlen(buffer.c_str()));
15
return
buffer;
16
#else
17
return
std::string(strerror(errno));
18
#endif
19
}
20
}
// namespace Log
Log
Definition
EntityToIDString.hpp:7
Log::GetErrnoMessage
std::string GetErrnoMessage()
Definition
Exception.hpp:9
src
utils
log
src
Exception.hpp
Generated by
1.16.1