Make mman functions public in memmap.h header for Win32

This commit is contained in:
twinaphex 2015-08-12 15:48:52 +02:00
parent 7f615fc781
commit d4c0a09a03
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@
#define MAP_ANONYMOUS MAP_ANON
#endif
#if !defined(HAVE_MMAN)
#if !defined(HAVE_MMAN) || defined(_WIN32)
void* mmap(void *desired_addr, size_t len, int mmap_prot, int mmap_flags, int fildes, size_t off);
void munmap(void *base_addr, size_t len);

View File

@ -46,7 +46,7 @@
# define DWORD_LO(x) (x)
#endif
static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset)
{
uint32_t flProtect, dwDesiredAccess;
off_t end;
@ -108,13 +108,13 @@ static void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t
return ret;
}
static void munmap(void *addr, size_t length)
void munmap(void *addr, size_t length)
{
UnmapViewOfFile(addr);
/* ruh-ro, we leaked handle from CreateFileMapping() ... */
}
static int mprotect(void *addr, size_t len, int prot)
int mprotect(void *addr, size_t len, int prot)
{
/* Incomplete, just assumes PAGE_EXECUTE_READWRITE right now
* instead of correctly handling prot */