Skip to content

Commit

Permalink
Get rid of unused defines in mingw.h (#583)
Browse files Browse the repository at this point in the history
* Get rid of unused defines in mingw.h
  • Loading branch information
slyshykO authored and xor-gate committed Apr 6, 2017
1 parent 47ab290 commit eb03b7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/mingw/mingw.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@
#define _USE_W32_SOCKETS 1
#include <windows.h>

#define ENOTCONN WSAENOTCONN
#define EWOULDBLOCK WSAEWOULDBLOCK
#define ENOBUFS WSAENOBUFS
#define ECONNRESET WSAECONNRESET
#define ESHUTDOWN WSAESHUTDOWN
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
#define EINPROGRESS WSAEINPROGRESS
#define EISCONN WSAEISCONN

/* winsock doesn't feature poll(), so there is a version implemented
* in terms of select() in mingw.c. The following definitions
Expand Down
4 changes: 3 additions & 1 deletion src/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ void *mmap (void *addr, size_t len, int prot, int flags, int fd, long long offs

count = read(fd, buf, len);

if (count != len) {
if (count != (ssize_t)len) {
free (buf);
return MAP_FAILED;
}

return buf;
(void)flags;
}

int munmap (void *addr, size_t len) {
free (addr);
return 0;
(void)len;
}

0 comments on commit eb03b7c

Please sign in to comment.