From: Nick Mathewson Date: Sun, 9 May 2010 02:21:52 +0000 (-0400) Subject: Define _REENTRANT as needed on Solaris, elsewhere X-Git-Tag: release-2.0.5-beta~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c1cd32a156b75fa692471def021261126df33f88;p=libevent Define _REENTRANT as needed on Solaris, elsewhere It turns out that _REENTRANT isn't only needed to make certain functions visible; we also need it to make pthreads work properly some places (like Solaris, where forgetting _REENTRANT basically means that all threads are sharing the same errno). Fortunately, our ACX_PTHREAD() configure macro already gives us a PTHREAD_CFLAG variable, so all we have to do is use it. --- diff --git a/configure.in b/configure.in index 2357db41..54e0f175 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,8 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_GCC_TRADITIONAL -if test "$GCC" = yes ; then + +if test "$GCC" = "yes" ; then # Enable many gcc warnings by default... CFLAGS="$CFLAGS -Wall" # And disable the strict-aliasing optimization, since it breaks @@ -515,11 +516,12 @@ AC_TRY_COMPILE([], # check if we can compile with pthreads have_pthreads=no -if test x$bwin32 != xtrue; then +if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then ACX_PTHREAD([ AC_DEFINE(HAVE_PTHREADS, 1, [Define if we have pthreads on this system]) have_pthreads=yes]) + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" fi AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"]) diff --git a/evutil.c b/evutil.c index 177c137e..639a51a3 100644 --- a/evutil.c +++ b/evutil.c @@ -26,7 +26,6 @@ #include "event-config.h" -#define _REENTRANT #define _GNU_SOURCE #ifdef WIN32 diff --git a/http.c b/http.c index 53943c78..5d3631fc 100644 --- a/http.c +++ b/http.c @@ -27,8 +27,6 @@ #include "event-config.h" -#define _REENTRANT - #ifdef _EVENT_HAVE_SYS_PARAM_H #include #endif