Scrcpy is a C11 project. Use the C99 standard types instead of the
SDL-specific types:
SDL_bool -> bool
SintXX -> intXX_t
UintXX -> uintXX_t
25 lines
363 B
C
25 lines
363 B
C
#include "net.h"
|
|
|
|
#include "log.h"
|
|
|
|
bool
|
|
net_init(void) {
|
|
WSADATA wsa;
|
|
int res = WSAStartup(MAKEWORD(2, 2), &wsa) < 0;
|
|
if (res < 0) {
|
|
LOGC("WSAStartup failed with error %d", res);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void
|
|
net_cleanup(void) {
|
|
WSACleanup();
|
|
}
|
|
|
|
bool
|
|
net_close(socket_t socket) {
|
|
return !closesocket(socket);
|
|
}
|