diff --git a/Makefile.am b/Makefile.am index bd2cbd72..8511dc45 100644 --- a/Makefile.am +++ b/Makefile.am @@ -97,7 +97,7 @@ SUBDIRS = . include sample test if BUILD_WIN32 -SYS_LIBS = -lws2_32 +SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 SYS_SRC = win32select.c evthread_win32.c buffer_iocp.c event_iocp.c \ bufferevent_async.c SYS_INCLUDES = -IWIN32-Code diff --git a/configure.in b/configure.in index 46e473c5..7e7c217b 100644 --- a/configure.in +++ b/configure.in @@ -39,6 +39,7 @@ dnl the 'host' machine is where the resulting stuff runs. dnl Checks for programs. AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LN_S # AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE @@ -148,8 +149,7 @@ AC_SEARCH_LIBS([SSL_new], [ssl], [have_openssl=yes OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32" AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])], - [have_openssl=no - AC_DEFINE(HAVE_OPENSSL, 0, [Define if the system lacks openssl])], + [have_openssl=no], [-lcrypto $EV_LIB_GDI $EV_LIB_WS32]) LIBS="$save_LIBS" AC_SUBST(OPENSSL_LIBS) diff --git a/sample/http-server.c b/sample/http-server.c index 05dc165e..75caa414 100644 --- a/sample/http-server.c +++ b/sample/http-server.c @@ -19,6 +19,9 @@ #include #include #include +#ifndef S_ISDIR +#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) +#endif #else #include #include diff --git a/test/Makefile.am b/test/Makefile.am index 01bd203f..b867501f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -54,8 +54,7 @@ regress_SOURCES += regress_iocp.c endif regress_LDADD = $(LIBEVENT_GC_SECTIONS) ../libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS) -regress_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat \ - -I$(top_srcdir)/include -I../include $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) +regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS) regress_LDFLAGS = $(PTHREAD_CFLAGS) if OPENSSL diff --git a/test/bench.c b/test/bench.c index 59cb6df5..d0f831b9 100644 --- a/test/bench.c +++ b/test/bench.c @@ -37,8 +37,11 @@ #include #include +#ifdef _EVENT_HAVE_SYS_TIME_H #include +#endif #ifdef WIN32 +#define WIN32_LEAN_AND_MEAN #include #else #include @@ -49,7 +52,9 @@ #include #include #include +#ifdef _EVENT_HAVE_UNISTD_H #include +#endif #include #include @@ -102,12 +107,12 @@ run_once(void) count = 0; writes = num_writes; { int xcount = 0; - gettimeofday(&ts, NULL); + evutil_gettimeofday(&ts, NULL); do { event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK); xcount++; } while (count != fired); - gettimeofday(&te, NULL); + evutil_gettimeofday(&te, NULL); if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count); } diff --git a/test/bench_cascade.c b/test/bench_cascade.c index 6b508ef1..c25255ed 100644 --- a/test/bench_cascade.c +++ b/test/bench_cascade.c @@ -29,8 +29,11 @@ #include #include +#ifdef _EVENT_HAVE_SYS_TIME_H #include +#endif #ifdef WIN32 +#define WIN32_LEAN_AND_MEAN #include #else #include @@ -41,7 +44,9 @@ #include #include #include +#ifdef _EVENT_HAVE_UNISTD_H #include +#endif #include #include @@ -92,7 +97,7 @@ run_once(int num_pipes) } /* measurements includes event setup */ - gettimeofday(&ts, NULL); + evutil_gettimeofday(&ts, NULL); /* provide a default timeout for events */ evutil_timerclear(&tv_timeout); @@ -111,7 +116,7 @@ run_once(int num_pipes) event_dispatch(); - gettimeofday(&te, NULL); + evutil_gettimeofday(&te, NULL); evutil_timersub(&te, &ts, &te); for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { diff --git a/test/bench_httpclient.c b/test/bench_httpclient.c index 87103cc8..25db4a7d 100644 --- a/test/bench_httpclient.c +++ b/test/bench_httpclient.c @@ -88,7 +88,7 @@ errorcb(struct bufferevent *b, short what, void *arg) if (what & BEV_EVENT_EOF) { ++total_n_handled; total_n_bytes += ri->n_read; - gettimeofday(&now, NULL); + evutil_gettimeofday(&now, NULL); evutil_timersub(&now, &ri->started, &diff); evutil_timeradd(&diff, &total_time, &total_time); @@ -152,7 +152,7 @@ launch_request(void) ri = malloc(sizeof(*ri)); ri->n_read = 0; - gettimeofday(&ri->started, NULL); + evutil_gettimeofday(&ri->started, NULL); b = bufferevent_socket_new(base, sock, BEV_OPT_CLOSE_ON_FREE); @@ -184,11 +184,11 @@ main(int argc, char **argv) perror("launch"); } - gettimeofday(&start, NULL); + evutil_gettimeofday(&start, NULL); event_base_dispatch(base); - gettimeofday(&end, NULL); + evutil_gettimeofday(&end, NULL); evutil_timersub(&end, &start, &total); usec = total_time.tv_sec * 1000000 + total_time.tv_usec;