The platform-specific code for net.c was implemented in sys/*/net.c. But the differences are quite limited, so use ifdef-blocks in the single net.c instead.master
parent
229eeb24a2
commit
db6252e52b
@ -1,21 +0,0 @@
|
|||||||
#include "util/net.h"
|
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
bool
|
|
||||||
net_init(void) {
|
|
||||||
// do nothing
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
net_cleanup(void) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
net_close(socket_t socket) {
|
|
||||||
return !close(socket);
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
#include "util/net.h"
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "util/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);
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue