From e8343e9ff18b768fdc0944da18350349ef26cdf0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 22 May 2009 19:11:59 +0000 Subject: [PATCH] work around missing __func__ in sample code svn:r1310 --- sample/signal-test.c | 13 +++++++++++++ sample/time-test.c | 14 ++++++++++++++ 2 files changed, 27 insertions(+) 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();