Previous 199869 Revisions Next

r33188 Tuesday 4th November, 2014 at 00:48:51 UTC by R. Belmont
OS/2 build fixes [KO Myung-Hun]
[src/lib/sqlite3]sqlite3.c
[src/lib/web]mongoose.c

trunk/src/lib/sqlite3/sqlite3.c
r241699r241700
84948494/*
84958495** Disable MMAP on platforms where it is known to not work
84968496*/
8497#if defined(__OpenBSD__) || defined(__QNXNTO__)
8497#if defined(__OpenBSD__) || defined(__QNXNTO__) || defined(__OS2__)
84988498# undef SQLITE_MAX_MMAP_SIZE
84998499# define SQLITE_MAX_MMAP_SIZE 0
8500# ifdef __OS2__
8501#  undef SQLITE_OMIT_WAL
8502#  define SQLITE_OMIT_WAL 0
8503# endif
85008504#endif
85018505
85028506/*
trunk/src/lib/web/mongoose.c
r241699r241700
7272#include <stdlib.h>
7373#include <string.h>
7474#include <time.h>
75#ifdef __OS2__
76#include <sys/time.h>  // struct timeval
77#endif
7578#include <signal.h>
7679
7780#ifdef _WIN32
r241699r241700
120123#include <sys/socket.h>
121124#include <sys/select.h>
122125#define closesocket(x) close(x)
126#ifdef __OS2__
127typedef int socklen_t;
128#else
123129#define __cdecl
130#endif
124131#define INVALID_SOCKET (-1)
125132#define to64(x) strtoll(x, NULL, 10)
126133typedef int sock_t;
r241699r241700
11701177#include <dlfcn.h>
11711178#include <inttypes.h>
11721179#include <pwd.h>
1180#ifndef __OS2__
11731181#define O_BINARY 0
1182#endif
11741183#define INT64_FMT PRId64
11751184typedef struct stat file_stat_t;
11761185typedef pid_t process_id_t;
r241699r241700
51525161#define MAP_FAILED NULL
51535162#define MAP_PRIVATE 0
51545163#define PROT_READ 0
5164#elif defined(__OS2__)
5165static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
5166               int offset) {
5167   void *p;
5168   off_t curpos;
5169
5170   p = malloc(len);
5171   if (!p)
5172       return NULL;
5173
5174   curpos = lseek(fd, 0, SEEK_CUR);
5175   lseek(fd, offset, SEEK_SET);
5176   read(fd, p, len);
5177   lseek(fd, curpos, SEEK_SET);
5178
5179   return p;
5180}
5181
5182#define munmap(x, y)  free(x)
5183#define MAP_FAILED NULL
5184#define MAP_PRIVATE 0
5185#define PROT_READ 0
51555186#else
51565187#include <sys/mman.h>
51575188#endif


Previous 199869 Revisions Next


© 1997-2024 The MAME Team