]> granicus.if.org Git - libevent/commitdiff
work around missing __func__ in sample code
authorNick Mathewson <nickm@torproject.org>
Fri, 22 May 2009 19:11:59 +0000 (19:11 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 22 May 2009 19:11:59 +0000 (19:11 +0000)
svn:r1310

sample/signal-test.c
sample/time-test.c

index cd1302f4096132a74ba1a7425dbc044bc98ebb25..165883fb5aa483eecd1b5237abdec09d975cd4c7 100644 (file)
 
 #include <event.h>
 
+#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();
index a9504ba1f95e68721134344496660b1cf0b4aa96..4c87d7787c3348446bb2f2bcd751655d0764ac60 100644 (file)
 #include <event.h>
 #include <evutil.h>
 
+#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();