Use the cross-platform socket file descriptor type

Windows and unix use a diferent data type for representing socket file
descriptors (SOCKET vs int). This mismatch results in a compiler warning
when comparing to S_INVALID.
This commit is contained in:
Jef Driesen 2020-08-24 13:24:54 +02:00
parent b0cce363f1
commit fc76b4a258

View File

@ -155,7 +155,7 @@ dc_irda_iterator_new (dc_iterator_t **out, dc_context_t *context, dc_descriptor_
}
// Open the socket.
int fd = socket (AF_IRDA, SOCK_STREAM, 0);
s_socket_t fd = socket (AF_IRDA, SOCK_STREAM, 0);
if (fd == S_INVALID) {
s_errcode_t errcode = S_ERRNO;
SYSERROR (context, errcode);