Try and fix compilation and running of test-fdleak on Windows.

This commit is contained in:
Ross Lagerwall 2012-02-25 07:47:49 +02:00
parent 1c4288f492
commit 4293a809b7

View File

@ -26,6 +26,10 @@
#include "event2/event-config.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#include <string.h>
#include <stdlib.h>
#ifdef _EVENT_HAVE_SYS_TIME_H
@ -186,7 +190,7 @@ start_client(struct event_base *base)
int
main(int argc, char **argv)
{
#if !defined(_WIN32) && defined(_EVENT_HAVE_SETRLIMIT)
#ifdef _EVENT_HAVE_SETRLIMIT
/* Set the fd limit to a low value so that any fd leak is caught without
making many requests. */
struct rlimit rl;
@ -197,6 +201,11 @@ main(int argc, char **argv)
}
#endif
#ifdef _WIN32
WSADATA WSAData;
WSAStartup(0x101, &WSAData);
#endif
/* Set up an address, used by both client & server. */
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;