1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-12-22 04:02:04 +03:00

Compile Warnings for Visual Studio (#132)

This commit is contained in:
bel
2015-05-22 17:39:28 +02:00
parent da42c746b0
commit 3c810102d1

View File

@@ -10,21 +10,23 @@ mmap(void *addr, int64_t len, int prot, int flags, int fd, int offset)
/* TODO: This is an incomplete implementation of mmap for windows.
* Currently it is sufficient, but there are a lot of unused parameters.
*/
HANDLE fh = (HANDLE)_get_osfhandle(fd);
HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t)len);
CloseHandle(mh);
/* unused parameters */
(void)addr;
(void)prot;
(void)flags;
(void)offset;
HANDLE fh = (HANDLE)_get_osfhandle(fd);
HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t)len);
CloseHandle(mh);
return p;
}
static void munmap(void *addr, int64_t length)
{
/* unused parameters */
(void)length;
UnmapViewOfFile(addr);