mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 05:14:46 -04:00
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:
parent
3d9e05b174
commit
c1cd32a156
@ -20,7 +20,8 @@ AC_PROG_INSTALL
|
|||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
|
|
||||||
AC_PROG_GCC_TRADITIONAL
|
AC_PROG_GCC_TRADITIONAL
|
||||||
if test "$GCC" = yes ; then
|
|
||||||
|
if test "$GCC" = "yes" ; then
|
||||||
# Enable many gcc warnings by default...
|
# Enable many gcc warnings by default...
|
||||||
CFLAGS="$CFLAGS -Wall"
|
CFLAGS="$CFLAGS -Wall"
|
||||||
# And disable the strict-aliasing optimization, since it breaks
|
# And disable the strict-aliasing optimization, since it breaks
|
||||||
@ -515,11 +516,12 @@ AC_TRY_COMPILE([],
|
|||||||
|
|
||||||
# check if we can compile with pthreads
|
# check if we can compile with pthreads
|
||||||
have_pthreads=no
|
have_pthreads=no
|
||||||
if test x$bwin32 != xtrue; then
|
if test x$bwin32 != xtrue && test "$enable_thread_support" != "no"; then
|
||||||
ACX_PTHREAD([
|
ACX_PTHREAD([
|
||||||
AC_DEFINE(HAVE_PTHREADS, 1,
|
AC_DEFINE(HAVE_PTHREADS, 1,
|
||||||
[Define if we have pthreads on this system])
|
[Define if we have pthreads on this system])
|
||||||
have_pthreads=yes])
|
have_pthreads=yes])
|
||||||
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
|
AM_CONDITIONAL(PTHREADS, [test "$have_pthreads" != "no" && test "$enable_thread_support" != "no"])
|
||||||
|
|
||||||
|
1
evutil.c
1
evutil.c
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "event-config.h"
|
#include "event-config.h"
|
||||||
|
|
||||||
#define _REENTRANT
|
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
Loading…
x
Reference in New Issue
Block a user