mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 04:19:10 -04:00
Try and fix compilation and running of test-fdleak on Windows.
This commit is contained in:
parent
1c4288f492
commit
4293a809b7
@ -26,6 +26,10 @@
|
|||||||
|
|
||||||
#include "event2/event-config.h"
|
#include "event2/event-config.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef _EVENT_HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
@ -186,7 +190,7 @@ start_client(struct event_base *base)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
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
|
/* Set the fd limit to a low value so that any fd leak is caught without
|
||||||
making many requests. */
|
making many requests. */
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
@ -197,6 +201,11 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
WSADATA WSAData;
|
||||||
|
WSAStartup(0x101, &WSAData);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set up an address, used by both client & server. */
|
/* Set up an address, used by both client & server. */
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user