aboutsummaryrefslogtreecommitdiff
path: root/src/SMemUtf8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMemUtf8.cpp')
-rw-r--r--src/SMemUtf8.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/SMemUtf8.cpp b/src/SMemUtf8.cpp
index abc16ee..b9d5e9d 100644
--- a/src/SMemUtf8.cpp
+++ b/src/SMemUtf8.cpp
@@ -551,3 +551,32 @@ DWORD WINAPI SMemFileNameToUTF8(
pOutLength[0] = nOutLength;
return dwErrCode;
}
+
+//-----------------------------------------------------------------------------
+// (Set/Get)LastError wrapper
+
+#ifndef STORMLIB_WINDOWS
+#ifndef STORMLIB_WIIU
+static thread_local DWORD dwLastError = ERROR_SUCCESS;
+#else
+static DWORD dwLastError = ERROR_SUCCESS;
+#endif
+#endif
+
+void SErrSetLastError(DWORD dwErrCode)
+{
+#ifdef STORMLIB_WINDOWS
+ SetLastError(dwErrCode);
+#else
+ dwLastError = dwErrCode;
+#endif
+}
+
+DWORD SErrGetLastError()
+{
+#ifdef STORMLIB_WINDOWS
+ return GetLastError();
+#else
+ return dwLastError;
+#endif
+}