mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-09-10 20:36:00 -05:00
CommonFuncs: Add StrerrorString version of LastStrerrorString that accepts an error number.
This commit is contained in:
@@ -43,13 +43,18 @@ const char* StrErrorWrapper(int error, char* buffer, std::size_t length)
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string StrerrorString(int error)
|
||||
{
|
||||
char error_message[BUFFER_SIZE];
|
||||
|
||||
return StrErrorWrapper(error, error_message, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
// Wrapper function to get last strerror(errno) string.
|
||||
// This function might change the error code.
|
||||
std::string LastStrerrorString()
|
||||
{
|
||||
char error_message[BUFFER_SIZE];
|
||||
|
||||
return StrErrorWrapper(errno, error_message, BUFFER_SIZE);
|
||||
return StrerrorString(errno);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user