]> granicus.if.org Git - libevent/commitdiff
Define _REENTRANT as needed on Solaris, elsewhere
authorNick Mathewson <nickm@torproject.org>
Sun, 9 May 2010 02:21:52 +0000 (22:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 9 May 2010 02:21:52 +0000 (22:21 -0400)
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.

configure.in
evutil.c
http.c

index 2357db41843ffe8159b356ddd3ffa55cca2562ce..54e0f1757fe3e52523b90314266b4b00ba43efc4 100644 (file)
@@ -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"])
 
index 177c137e3ce07cc4a917e46f7ed306386d93da2a..639a51a3ce9138f84c8e14b412d8228c6954f724 100644 (file)
--- 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 53943c78943ee072386609529589903a6e87f384..5d3631fc53b22d0bcb207e77e1fb3ac89f5db208 100644 (file)
--- a/http.c
+++ b/http.c
@@ -27,8 +27,6 @@
 
 #include "event-config.h"
 
-#define _REENTRANT
-
 #ifdef _EVENT_HAVE_SYS_PARAM_H
 #include <sys/param.h>
 #endif