From: twinaphex Date: Tue, 13 Aug 2013 02:16:04 +0000 (+0200) Subject: (Win32) Works now with Win32 Mingw - had to implement mmap implementation X-Git-Tag: v1.85~7 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e4662411c4aa87085c30a1709ded83b8ee17dd;p=picodrive.git (Win32) Works now with Win32 Mingw - had to implement mmap implementation with malloc and mfree with free --- diff --git a/platform/libretro.c b/platform/libretro.c index d246cad5..d5430978 100644 --- a/platform/libretro.c +++ b/platform/libretro.c @@ -78,17 +78,7 @@ void* mmap(void *desired_addr, HANDLE fd, size_t off) { - HANDLE fmh; - void *base_addr; - SECURITY_ATTRIBUTES sa; - sa.nLength = sizeof(sa); - sa.lpSecurityDescriptor = NULL; - sa.bInheritHandle = TRUE; - fmh = CreateFileMapping(fd, &sa, PAGE_WRITECOPY , 0, len, NULL); - if (fmh == NULL){ return NULL; } - base_addr = MapViewOfFileEx(fmh, FILE_MAP_WRITE|FILE_MAP_READ, 0, off, len, desired_addr); - CloseHandle(fmh); - return base_addr; + return malloc(len); } void munmap( @@ -96,7 +86,7 @@ void munmap( size_t len ) { - UnmapViewOfFile(base_addr); + free(base_addr); } #define MAP_FAILED 0 #define PROT_READ 0