Differences From Artifact [2eb48e2252]:
- File src/socket_helpers.h — part of check-in [c7a45d0140] at 2017-05-17 00:13:13 on branch trunk — Add in_addr_t for MorphOS (user: js, size: 2635) [annotate] [blame] [check-ins using]
To Artifact [77b020019f]:
- File
src/socket_helpers.h
— part of check-in
[b4cd87cd81]
at
2017-05-21 23:57:34
on branch trunk
— Use closesocket() instead of close()
Previously, socket_helpers.h would just define close() to whatever is
needed to close a socket. However, this makes it possible to
accidentally call a socket-specific close on something that is not a
socket. Having to explicitly call closesocket() (and defining it to
close() on platforms where it's the same) prevents this. (user: js, size: 2668) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
57 58 59 60 61 62 63 | # define SOMAXCONN 16 #endif #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif | | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | # define SOMAXCONN 16 #endif #ifndef SOCK_CLOEXEC # define SOCK_CLOEXEC 0 #endif #if !defined(OF_WINDOWS) && !defined(OF_WII) # define closesocket(sock) close(sock) #endif #ifdef OF_MORPHOS typedef uint32_t in_addr_t; #endif #ifdef OF_WII # define accept(sock, addr, addrlen) net_accept(sock, addr, addrlen) # define bind(sock, addr, addrlen) net_bind(sock, addr, addrlen) # define closesocket(sock) net_close(sock) # define connect(sock, addr, addrlen) net_connect(sock, addr, addrlen) # define gethostbyname(name) net_gethostbyname(name) # define h_errno 0 # define hstrerror(err) "unknown (no hstrerror)" # define listen(sock, backlog) net_listen(sock, backlog) # define poll(fds, nfds, timeout) net_poll(fds, nfds, timeout) # define recv(sock, buf, len, flags) net_recv(sock, buf, len, flags) |
︙ | ︙ |