summaryrefslogtreecommitdiff
path: root/src/common/misc.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-09-21 11:29:48 -0700
committerGravatar GitHub2016-09-21 11:29:48 -0700
commitd5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch)
tree8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/common/misc.cpp
parentREADME: Specify master branch for Travis CI badge (diff)
parentFix Travis clang-format check (diff)
downloadyuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.gz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.xz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.zip
Merge pull request #2086 from linkmauve/clang-format
Add clang-format as part of our {commit,travis}-time checks
Diffstat (limited to 'src/common/misc.cpp')
-rw-r--r--src/common/misc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/common/misc.cpp b/src/common/misc.cpp
index d2a049b63..7be2235b0 100644
--- a/src/common/misc.cpp
+++ b/src/common/misc.cpp
@@ -3,7 +3,6 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <cstddef> 5#include <cstddef>
6
7#ifdef _WIN32 6#ifdef _WIN32
8#include <windows.h> 7#include <windows.h>
9#else 8#else
@@ -12,23 +11,21 @@
12#endif 11#endif
13 12
14// Neither Android nor OS X support TLS 13// Neither Android nor OS X support TLS
15#if defined(__APPLE__) || (ANDROID && __clang__) 14#if defined(__APPLE__) || (ANDROID && __clang__)
16#define __thread 15#define __thread
17#endif 16#endif
18 17
19// Generic function to get last error message. 18// Generic function to get last error message.
20// Call directly after the command or use the error num. 19// Call directly after the command or use the error num.
21// This function might change the error code. 20// This function might change the error code.
22const char* GetLastErrorMsg() 21const char* GetLastErrorMsg() {
23{
24 static const size_t buff_size = 255; 22 static const size_t buff_size = 255;
25 23
26#ifdef _WIN32 24#ifdef _WIN32
27 static __declspec(thread) char err_str[buff_size] = {}; 25 static __declspec(thread) char err_str[buff_size] = {};
28 26
29 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(), 27 FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, GetLastError(),
30 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 28 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), err_str, buff_size, nullptr);
31 err_str, buff_size, nullptr);
32#else 29#else
33 static __thread char err_str[buff_size] = {}; 30 static __thread char err_str[buff_size] = {};
34 31