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.
This commit is contained in:
Nick Mathewson 2010-05-08 22:21:52 -04:00
parent 3d9e05b174
commit c1cd32a156
3 changed files with 4 additions and 5 deletions

View 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"])

View File

@ -26,7 +26,6 @@
#include "event-config.h"
#define _REENTRANT
#define _GNU_SOURCE
#ifdef WIN32

2
http.c
View File

@ -27,8 +27,6 @@
#include "event-config.h"
#define _REENTRANT
#ifdef _EVENT_HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif