diff options
Diffstat (limited to '3rdparty')
-rw-r--r-- | 3rdparty/mongoose/mongoose.c | 36 | ||||
-rw-r--r-- | 3rdparty/sqlite3/sqlite3.c | 6 |
2 files changed, 41 insertions, 1 deletions
diff --git a/3rdparty/mongoose/mongoose.c b/3rdparty/mongoose/mongoose.c index 9c7ca165271..9014b90bf79 100644 --- a/3rdparty/mongoose/mongoose.c +++ b/3rdparty/mongoose/mongoose.c @@ -124,7 +124,12 @@ typedef struct _stati64 ns_stat_t; #include <sys/socket.h> #include <sys/select.h> #define closesocket(x) close(x) +#ifndef __OS2__ #define __cdecl +#else +#include <sys/time.h> +typedef int socklen_t; +#endif #define INVALID_SOCKET (-1) #define to64(x) strtoll(x, NULL, 10) typedef int sock_t; @@ -1554,6 +1559,37 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd, #define MAP_FAILED NULL #define MAP_PRIVATE 0 #define PROT_READ 0 +#elif defined(__OS2__) +static void *mmap(void *addr, int64_t len, int prot, int flags, int fd, + int offset) { + void *p; + + int pos = lseek( fd, 0, SEEK_CUR ); /* Get a current position */ + + if (pos == -1) + return NULL; + + /* Seek to offset offset */ + if (lseek( fd, offset, SEEK_SET) == -1) + return NULL; + + p = malloc(len); + + /* Read in a file */ + if (!p || read(fd, p, len) == -1) { + free(p); + p = NULL; + } + + /* Restore the position */ + lseek(fd, pos, SEEK_SET); + + return p; +} +#define munmap(x, y) free(x) +#define MAP_FAILED NULL +#define MAP_PRIVATE 0 +#define PROT_READ 0 #else #include <sys/mman.h> #endif diff --git a/3rdparty/sqlite3/sqlite3.c b/3rdparty/sqlite3/sqlite3.c index 33fb95c96a9..eee15296b9d 100644 --- a/3rdparty/sqlite3/sqlite3.c +++ b/3rdparty/sqlite3/sqlite3.c @@ -8706,11 +8706,15 @@ SQLITE_PRIVATE const int sqlite3one; /* ** Disable MMAP on platforms where it is known to not work */ -#if defined(__OpenBSD__) || defined(__QNXNTO__) +#if defined(__OpenBSD__) || defined(__QNXNTO__) || defined(__OS2__) # undef SQLITE_MAX_MMAP_SIZE # define SQLITE_MAX_MMAP_SIZE 0 #endif +#ifdef __OS2__ +# define SQLITE_OMIT_WAL +#endif + /* ** Default maximum size of memory used by memory-mapped I/O in the VFS */ |