summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar ShizZy2013-09-08 20:41:23 -0400
committerGravatar ShizZy2013-09-08 20:41:23 -0400
commit7ea22ffcdb7e716bd08de84ec9949130932e69e8 (patch)
tree248f17607e162cbe46c7934eb14a47f4b32d5fca
parentenabled StringPooling and EnableEnhancedInstructionSet (diff)
downloadyuzu-7ea22ffcdb7e716bd08de84ec9949130932e69e8.tar.gz
yuzu-7ea22ffcdb7e716bd08de84ec9949130932e69e8.tar.xz
yuzu-7ea22ffcdb7e716bd08de84ec9949130932e69e8.zip
re-enabled GetLastErrorMsg
-rw-r--r--src/common/src/misc.cpp42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/common/src/misc.cpp b/src/common/src/misc.cpp
index 719a98cb9..5b9e38ffb 100644
--- a/src/common/src/misc.cpp
+++ b/src/common/src/misc.cpp
@@ -4,6 +4,10 @@
4 4
5#include "common.h" 5#include "common.h"
6 6
7#ifdef _WIN32
8#include <windows.h>
9#endif
10
7// Neither Android nor OS X support TLS 11// Neither Android nor OS X support TLS
8#if defined(__APPLE__) || (ANDROID && __clang__) 12#if defined(__APPLE__) || (ANDROID && __clang__)
9#define __thread 13#define __thread
@@ -12,22 +16,22 @@
12// Generic function to get last error message. 16// Generic function to get last error message.
13// Call directly after the command or use the error num. 17// Call directly after the command or use the error num.
14// This function might change the error code. 18// This function might change the error code.
15//const char* GetLastErrorMsg() 19const char* GetLastErrorMsg()
16//{ 20{
17// static const size_t buff_size = 255; 21 static const size_t buff_size = 255;
18// 22
19//#ifdef _WIN32 23#ifdef _WIN32
20// static __declspec(thread) char err_str[buff_size] = {}; 24 static __declspec(thread) char err_str[buff_size] = {};
21// 25
22// FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 26 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
23// MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 27 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
24// err_str, buff_size, NULL); 28 err_str, buff_size, NULL);
25//#else 29#else
26// static __thread char err_str[buff_size] = {}; 30 static __thread char err_str[buff_size] = {};
27// 31
28// // Thread safe (XSI-compliant) 32 // Thread safe (XSI-compliant)
29// strerror_r(errno, err_str, buff_size); 33 strerror_r(errno, err_str, buff_size);
30//#endif 34#endif
31// 35
32// return err_str; 36 return err_str;
33//} 37}