From 3fdb6be3166790ff3aad68dd4d4bb83963815e4b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Dec 2014 17:14:48 +0100 Subject: win32: add mmap() emulation Makes all of overlay_add work on windows/mingw. Since we now don't explicitly check for mmap() anymore (it's always present), this also requires us to make af_export.c compile, but I haven't tested it. --- osdep/io.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'osdep/io.h') diff --git a/osdep/io.h b/osdep/io.h index c3fc0cf9cb..0348d3d1a3 100644 --- a/osdep/io.h +++ b/osdep/io.h @@ -135,6 +135,17 @@ void mp_globfree(mp_glob_t *pglob); #undef fstat #define fstat(...) mp_fstat(__VA_ARGS__) +void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); +int munmap(void *addr, size_t length); +int msync(void *addr, size_t length, int flags); +#define PROT_READ 1 +#define PROT_WRITE 2 +#define MAP_SHARED 1 +#define MAP_FAILED ((void *)-1) +#define MS_ASYNC 1 +#define MS_SYNC 2 +#define MS_INVALIDATE 4 + #ifndef GLOB_NOMATCH #define GLOB_NOMATCH 3 #endif @@ -143,6 +154,10 @@ void mp_globfree(mp_glob_t *pglob); #define glob(...) mp_glob(__VA_ARGS__) #define globfree(...) mp_globfree(__VA_ARGS__) +#else /* __MINGW32__ */ + +#include + #endif /* __MINGW32__ */ #endif -- cgit v1.2.3