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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user