summaryrefslogtreecommitdiff
path: root/utils/config.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-03-31 22:41:37 +0100
committerVincent Sanders <vince@kyllikki.org>2015-03-31 22:41:37 +0100
commit82c7a7a4baf4a7a15381ee720799dc41c3d54909 (patch)
tree5f3b47ce1c0aca854323a8c7a06c94db5e05c373 /utils/config.h
parent87a38ca5c1624cb86d8c031b38166a00494d6be0 (diff)
downloadnetsurf-82c7a7a4baf4a7a15381ee720799dc41c3d54909.tar.gz
netsurf-82c7a7a4baf4a7a15381ee720799dc41c3d54909.tar.bz2
Fix RISC OS not having a pread/pwrite implementation.
Diffstat (limited to 'utils/config.h')
-rw-r--r--utils/config.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/utils/config.h b/utils/config.h
index c45b865fe..cfb9d83c3 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -39,7 +39,7 @@ char *strcasestr(const char *haystack, const char *needle);
#endif
/* Although these platforms might have strftime or strptime they
- * appear not to support the time_t seconds format specifier.
+ * appear not to support the time_t seconds format specifier.
*/
#if (defined(_WIN32) || defined(riscos) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
#undef HAVE_STRPTIME
@@ -49,8 +49,9 @@ char *strcasestr(const char *haystack, const char *needle);
#define HAVE_STRFTIME
#endif
-/* For some reason, UnixLib defines this unconditionally.
- * Assume we're using UnixLib if building for RISC OS. */
+/* For some reason, UnixLib defines this unconditionally. Assume we're using
+ * UnixLib if building for RISC OS.
+ */
#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(riscos))
#define HAVE_STRCHRNUL
#else
@@ -58,6 +59,19 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
+/* Although these are in POSIX and implemented most places, RISC OS is
+ * missing them.
+ */
+#if (defined(riscos))
+#undef HAVE_PREAD
+#undef HAVE_PWRITE
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+#else
+#define HAVE_PREAD
+#define HAVE_PWRITE
+#endif
+
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))