mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-17 16:41:28 +00:00
@@ -20,9 +20,9 @@ namespace Common {
|
||||
// glibc, mlibc, musl, and newlib all define their own variants of strerror_r
|
||||
// We don't need to use the preprocessor, we can just select depending on return type
|
||||
template<typename T> std::string HandleStrerrorR(T r, char *err_str);
|
||||
template<char*> std::string HandleStrerrorR(char* r, char *) { return std::string{r}; }
|
||||
template<char const*> std::string HandleStrerrorR(const char* r, char *) { return std::string{r}; }
|
||||
template<int> std::string HandleStrerrorR(int r, char *err_str) {
|
||||
template<> std::string HandleStrerrorR(char* r, char *) { return std::string{r}; }
|
||||
template<> std::string HandleStrerrorR(const char* r, char *) { return std::string{r}; }
|
||||
template<> std::string HandleStrerrorR(int r, char *err_str) {
|
||||
return std::string{r != 0
|
||||
? "(strerror_r failed to format error)"
|
||||
: err_str};
|
||||
|
||||
Reference in New Issue
Block a user