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. --- player/command.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'player') diff --git a/player/command.c b/player/command.c index b4e691c053..c690b6395e 100644 --- a/player/command.c +++ b/player/command.c @@ -60,9 +60,6 @@ #include "audio/decode/dec_audio.h" #include "options/path.h" #include "screenshot.h" -#if HAVE_SYS_MMAN_H -#include -#endif #ifndef __MINGW32__ #include #endif @@ -3825,13 +3822,9 @@ static void replace_overlay(struct MPContext *mpctx, int id, struct overlay *new *ptr = *new; recreate_overlays(mpctx); -#if HAVE_SYS_MMAN_H // Do this afterwards, so we never unmap while the OSD is using it. if (old.osd.bitmap && old.map_size) munmap(old.osd.bitmap, old.map_size); -#else - (void)old; -#endif } static int overlay_add(struct MPContext *mpctx, int id, int x, int y, @@ -3878,10 +3871,8 @@ static int overlay_add(struct MPContext *mpctx, int id, int x, int y, fd = open(file, O_RDONLY | O_BINARY | O_CLOEXEC); } if (fd >= 0) { -#if HAVE_SYS_MMAN_H overlay.map_size = h * stride; p = mmap(NULL, overlay.map_size, PROT_READ, MAP_SHARED, fd, offset); -#endif if (close_fd) close(fd); } -- cgit v1.2.3