Skip to content

d/remote: Add and use a multi-os r_socket_t typedef

On Linux, a socket descriptor as an int, while on Windows it is a SOCKET (aka an unsigned long long).

This patch introduces a r_socket_t typedef set depending on the OS, and uses it where needed.

The patch also reorders some header inclusions, to ensure that winsock2.h is included before windows.h, or else the winsock API is defined instead of the winsock2 API and a warning is emitted during compilation.

Also, the "#pragma comment(lib, 'ws2_32.lib')" directive used in r_hub.c is a VC++-ism, not compatible wth Mingw64 (gcc or clang toolchains). This patch replaces the pragma with a cmake link directive.

Edited by samuel degrande

Merge request reports