aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLadislav Zezula <zezula@volny.cz>2022-11-10 14:26:11 +0100
committerGitHub <noreply@github.com>2022-11-10 14:26:11 +0100
commit3235d01eab95af50c589a615bd8d492f911369f7 (patch)
tree80284993dc92a06c0fe20279517e6500fa980519
parent5dca772f3933338c0c14c082ad8781f55bf84141 (diff)
parent1153eba05e0f452c9919459fd02f7853e8ff894f (diff)
Merge pull request #267 from dcvz/wiiu-support
Merged. Thanks for the contribution.
-rw-r--r--src/FileStream.cpp5
-rw-r--r--src/StormPort.h28
2 files changed, 33 insertions, 0 deletions
diff --git a/src/FileStream.cpp b/src/FileStream.cpp
index d15316a..c431cb6 100644
--- a/src/FileStream.cpp
+++ b/src/FileStream.cpp
@@ -34,7 +34,12 @@
// Local functions - platform-specific functions
#ifndef STORMLIB_WINDOWS
+
+#ifndef STORMLIB_WIIU
static thread_local DWORD dwLastError = ERROR_SUCCESS;
+#else
+static DWORD dwLastError = ERROR_SUCCESS;
+#endif
DWORD GetLastError()
{
diff --git a/src/StormPort.h b/src/StormPort.h
index d386414..aa2c9f5 100644
--- a/src/StormPort.h
+++ b/src/StormPort.h
@@ -255,6 +255,34 @@
#endif
//-----------------------------------------------------------------------------
+// Defines for Wii U platform
+
+#if !defined(STORMLIB_PLATFORM_DEFINED) && defined(__WIIU__)
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+ #include <string.h>
+ #include <strings.h>
+ #include <ctype.h>
+ #include <assert.h>
+ #include <errno.h>
+ #include <malloc.h>
+
+ #undef STORMLIB_LITTLE_ENDIAN // Wii U is always big endian
+
+ #define STORMLIB_MAC // Use Mac compatible code
+ #define STORMLIB_WIIU
+ #define STORMLIB_PLATFORM_DEFINED
+
+#endif
+
+//-----------------------------------------------------------------------------
// Assumption: If the platform is not defined, assume a Linux-like platform
#if !defined(STORMLIB_PLATFORM_DEFINED)