add winsock initialization
This commit is contained in:
parent
bf3b8f3e56
commit
f768723eb4
|
@ -43,6 +43,19 @@ struct DPODriver
|
||||||
static void DPOUpdate(void * id, struct NoteFinder*nf)
|
static void DPOUpdate(void * id, struct NoteFinder*nf)
|
||||||
{
|
{
|
||||||
struct DPODriver * d = (struct DPODriver*)id;
|
struct DPODriver * d = (struct DPODriver*)id;
|
||||||
|
#ifdef WIN32
|
||||||
|
static int wsa_did_start;
|
||||||
|
if( !wsa_did_start )
|
||||||
|
{
|
||||||
|
|
||||||
|
WORD wVersionRequested;
|
||||||
|
WSADATA wsaData;
|
||||||
|
int err;
|
||||||
|
wVersionRequested = MAKEWORD(2, 2);
|
||||||
|
err = WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if( strcmp( d->oldaddress, d->address ) != 0 || d->socket == -1 || d->oldport != d->port )
|
if( strcmp( d->oldaddress, d->address ) != 0 || d->socket == -1 || d->oldport != d->port )
|
||||||
|
|
Loading…
Reference in a new issue