<div dir="auto">Pasting as inline because attachment got deleted<div dir="auto"><br></div><div dir="auto"><pre style="white-space:pre-wrap">commit 9d09f17f8f2200bf23eea9b8fabc0ef3a1dd4d16
Author: Vladimir Serbinenko <<a href="mailto:phcoder@google.com">phcoder@google.com</a>>
Date: Tue Mar 17 14:04:21 2020 +0100
Support for 3DS
diff --git a/src/physfs_platform_posix.c b/src/physfs_platform_posix.c
index fa2159c..90fff5f 100644
--- a/src/physfs_platform_posix.c
+++ b/src/physfs_platform_posix.c
@@ -58,6 +58,7 @@ static inline PHYSFS_ErrorCode errcodeFromErrno(void)
} /* errcodeFromErrno */
+#ifndef PHYSFS_HARDCODED_HOME
static char *getUserDirByUID(void)
{
uid_t uid = getuid();
@@ -83,10 +84,13 @@ static char *getUserDirByUID(void)
return retval;
} /* getUserDirByUID */
-
+#endif
char *__PHYSFS_platformCalcUserDir(void)
{
+#ifdef PHYSFS_HARDCODED_HOME
+ return strdup(PHYSFS_HARDCODED_HOME);
+#else
char *retval = NULL;
char *envr = getenv("HOME");
@@ -115,6 +119,7 @@ char *__PHYSFS_platformCalcUserDir(void)
retval = getUserDirByUID();
return retval;
+#endif
} /* __PHYSFS_platformCalcUserDir */
@@ -334,6 +339,7 @@ int __PHYSFS_platformStat(const char *fname, PHYSFS_Stat *st, const int follow)
return 1;
} /* __PHYSFS_platformStat */
+#include "ctr_pthread.h"
typedef struct
{
diff --git a/src/physfs_platform_unix.c b/src/physfs_platform_unix.c
index 10d93a7..7a81f39 100644
--- a/src/physfs_platform_unix.c
+++ b/src/physfs_platform_unix.c
@@ -213,7 +213,7 @@ static char *findBinaryInPath(const char *bin, char *envr)
return NULL; /* doesn't exist in path. */
} /* findBinaryInPath */
-
+#ifndef PHYSFS_HARDCODED_BASE_DIR
static char *readSymLink(const char *path)
{
ssize_t len = 64;
@@ -244,10 +244,13 @@ static char *readSymLink(const char *path)
allocator.Free(retval);
return NULL;
} /* readSymLink */
-
+#endif
char *__PHYSFS_platformCalcBaseDir(const char *argv0)
{
+#ifdef PHYSFS_HARDCODED_BASE_DIR
+ return strdup (PHYSFS_HARDCODED_BASE_DIR);
+#else
char *retval = NULL;
const char *envr = NULL;
@@ -329,6 +332,7 @@ char *__PHYSFS_platformCalcBaseDir(const char *argv0)
} /* if */
return retval;
+#endif
} /* __PHYSFS_platformCalcBaseDir */
diff --git a/src/physfs_platforms.h b/src/physfs_platforms.h
index d4e4bfd..96d5854 100644
--- a/src/physfs_platforms.h
+++ b/src/physfs_platforms.h
@@ -72,6 +72,13 @@
#elif defined(unix) || defined(__unix__)
# define PHYSFS_PLATFORM_UNIX 1
# define PHYSFS_PLATFORM_POSIX 1
+#elif defined(_3DS)
+# define PHYSFS_NO_CDROM_SUPPORT 1
+# define PHYSFS_PLATFORM_UNIX 1
+# define PHYSFS_PLATFORM_POSIX 1
+# define PHYSFS_HARDCODED_HOME "sdmc:/"
+# define PHYSFS_HARDCODED_BASE_DIR "sdmc:/"
+# define lstat stat
#else
# error Unknown platform.
#endif</pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020, 22:17 Vladimir Serbinenko <<a href="mailto:phcoder@google.com">phcoder@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">This allows the port of the game engine chailove to Nintendo 3DD</div>
</blockquote></div>