From a826a75800ce614a06ae53ddb95c54ccaf2f51d2 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 28 Jul 2009 19:41:48 +0000 Subject: [PATCH] Some tweaks to Brodie Thesfield's MSVC patch. svn:r1386 --- WIN32-Code/event-config.h | 4 +--- WIN32-Code/win32.c | 2 +- event_rpcgen.py | 4 ++++ test/regress_dns.c | 3 +++ test/regress_main.c | 5 ++++- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/WIN32-Code/event-config.h b/WIN32-Code/event-config.h index 6c85329b..0fd5d3f1 100644 --- a/WIN32-Code/event-config.h +++ b/WIN32-Code/event-config.h @@ -332,8 +332,6 @@ #define _EVENT_socklen_t unsigned int /* Define to `int' if does not define. */ -#define _EVENT_ssize_t intptr_t - -#define ssize_t SSIZE_T +#define _EVENT_ssize_t SSIZE_T #endif diff --git a/WIN32-Code/win32.c b/WIN32-Code/win32.c index 6c8ba217..47055885 100644 --- a/WIN32-Code/win32.c +++ b/WIN32-Code/win32.c @@ -334,7 +334,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv) } } if (win32op->writeset_out->fd_count) { - SOCKET s; + SOCKET s; i = rand() % win32op->writeset_out->fd_count; for (j=0; jwriteset_out->fd_count; ++j) { if (++i >= win32op->writeset_out->fd_count) diff --git a/event_rpcgen.py b/event_rpcgen.py index 136d6a83..6b8f5fa9 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -1561,9 +1561,13 @@ class CCodeGenerator: pre += ( '#include \n' '#include \n' '#include \n' + '#include \n' '#include \n' '#include \n' '#include \n\n' + '#ifdef _EVENT___func__\n' + '#define __func__ _EVENT___FUNC__\n' + '#endif\n\n' ) for statement in cppdirect: diff --git a/test/regress_dns.c b/test/regress_dns.c index 5b74fc4a..c535006e 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -70,6 +70,9 @@ static int dns_ok = 0; static int dns_got_cancel = 0; static int dns_err = 0; +/* XXXXX have evutil export this. */ +int evutil_strcasecmp(const char *, const char *); + static void dns_gethostbyname_cb(int result, char type, int count, int ttl, void *addresses, void *arg) diff --git a/test/regress_main.c b/test/regress_main.c index 3f2a2391..4bb0e694 100644 --- a/test/regress_main.c +++ b/test/regress_main.c @@ -28,13 +28,16 @@ #ifdef WIN32 #include #include -#define __func__ __FUNCTION__ #endif #ifdef HAVE_CONFIG_H #include "event-config.h" #endif +#ifdef _EVENT___func__ +#define __func__ _EVENT___func__ +#endif + #if 0 #include #include -- 2.40.0