common/misc: Deduplicate code in GetLastErrorMsg()

Android and macOS have supported thread_local for quite a while, but
most importantly is that we don't even really need it. Instead of using
a thread-local buffer, we can just return a non-static buffer as a
std::string, avoiding the need for that quality entirely.
This commit is contained in:
Lioncash 2018-07-19 09:03:30 -04:00
parent cd4fca8447
commit e0b8a35937
2 changed files with 8 additions and 12 deletions

View file

@ -4,6 +4,8 @@
#pragma once
#include <string>
#if !defined(ARCHITECTURE_x86_64) && !defined(ARCHITECTURE_ARM)
#include <cstdlib> // for exit
#endif
@ -90,7 +92,7 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
// Call directly after the command or use the error num.
// This function might change the error code.
// Defined in Misc.cpp.
const char* GetLastErrorMsg();
std::string GetLastErrorMsg();
namespace Common {