From: Nick Mathewson Date: Fri, 22 May 2009 19:11:59 +0000 (+0000) Subject: work around missing __func__ in sample code X-Git-Tag: release-2.0.3-alpha~212 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8343e9ff18b768fdc0944da18350349ef26cdf0;p=libevent work around missing __func__ in sample code svn:r1310 --- diff --git a/sample/signal-test.c b/sample/signal-test.c index cd1302f4..165883fb 100644 --- a/sample/signal-test.c +++ b/sample/signal-test.c @@ -27,6 +27,10 @@ #include +#ifdef _EVENT___func__ +#define __func__ _EVENT___func__ +#endif + int called = 0; static void @@ -46,6 +50,15 @@ int main (int argc, char **argv) { struct event signal_int; +#ifdef WIN32 + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD(2, 2); + + err = WSAStartup(wVersionRequested, &wsaData); +#endif /* Initalize the event library */ event_init(); diff --git a/sample/time-test.c b/sample/time-test.c index a9504ba1..4c87d778 100644 --- a/sample/time-test.c +++ b/sample/time-test.c @@ -27,6 +27,10 @@ #include #include +#ifdef _EVENT___func__ +#define __func__ _EVENT___func__ +#endif + int lasttime; static void @@ -51,6 +55,16 @@ main (int argc, char **argv) struct event timeout; struct timeval tv; +#ifdef WIN32 + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD(2, 2); + + err = WSAStartup(wVersionRequested, &wsaData); +#endif + /* Initalize the event library */ event_init();