Files
mtkports/www-client/netsurf/patches/0001-config-detect-montaukos.patch
T

46 lines
1.8 KiB
Diff

diff --git a/utils/config.h b/utils/config.h
index 3914771fd..578280321 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -119,7 +119,7 @@ char *strchrnul(const char *s, int c);
#endif
#define HAVE_UTSNAME
-#if (defined(_WIN32))
+#if (defined(_WIN32) || defined(__montauk__))
#undef HAVE_UTSNAME
#endif
@@ -144,8 +144,13 @@ char *realpath(const char *path, char *resolved_path);
#undef HAVE_STDOUT
#endif
+/* MontaukOS: the libc mmap() is anonymous-only (it is a thin wrapper over
+ * SYS_ALLOC and rejects any fd != -1), so the file fetcher's
+ * mmap(..., MAP_SHARED, fd, 0) fails and every file: URL dies with "Unable to
+ * map memory for file data buffer". The fread() fallback in the same function
+ * is what we want. */
#define HAVE_MMAP
-#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
+#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__) || defined(__montauk__))
#undef HAVE_MMAP
#endif
@@ -158,14 +163,14 @@ char *realpath(const char *path, char *resolved_path);
#define HAVE_DIRFD
#define HAVE_UNLINKAT
#define HAVE_FSTATAT
-#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
+#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__) || defined(__montauk__))
#undef HAVE_DIRFD
#undef HAVE_UNLINKAT
#undef HAVE_FSTATAT
#endif
#define HAVE_REGEX
-#if (defined(__serenity__))
+#if (defined(__serenity__) || defined(__montauk__))
#undef HAVE_REGEX
#endif