From a7a76d3d9eb77b4dd3129d34ba8df636ce2e6014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 4 Oct 2002 07:21:24 +0000 Subject: [PATCH] Patch #618347: Work around Solaris 2.6 pthread.h bug. Will backport to 2.2. --- Python/thread_pthread.h | 4 ++-- configure | 13 ++++++++++++- configure.in | 8 ++++++++ pyconfig.h.in | 3 +++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 556445e583a..c9f695726e2 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -3,11 +3,11 @@ #include #include -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #define destructor xxdestructor #endif #include -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(HAVE_PTHREAD_DESTRUCTOR) #undef destructor #endif #include diff --git a/configure b/configure index 9c995c34e99..181c98342ea 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1.348 . +# From configure.in Revision: 1.349 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # @@ -10885,6 +10885,17 @@ fi OSF1) LDLAST=-threads;; esac fi + + if test "$posix_threads" = yes -a \ + "$ac_sys_system" = "SunOS" -a \ + "$ac_sys_release" = "5.6"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PTHREAD_DESTRUCTOR 1 +_ACEOF + + fi + fi # Check for enable-ipv6 diff --git a/configure.in b/configure.in index 27462a60261..fef6e22f921 100644 --- a/configure.in +++ b/configure.in @@ -1326,6 +1326,14 @@ pthread_create (NULL, NULL, start_routine, NULL)], [ OSF1) LDLAST=-threads;; esac fi + + if test "$posix_threads" = yes -a \ + "$ac_sys_system" = "SunOS" -a \ + "$ac_sys_release" = "5.6"; then + AC_DEFINE(HAVE_PTHREAD_DESTRUCTOR, 1, + [Defined for Solaris 2.6 bug in pthread header.]) + fi + fi # Check for enable-ipv6 diff --git a/pyconfig.h.in b/pyconfig.h.in index 3622be8f5a1..f5cc30ead47 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -304,6 +304,9 @@ /* Define if you have GNU PTH threads. */ #undef HAVE_PTH +/* Defined for Solaris 2.6 bug in pthread header. */ +#undef HAVE_PTHREAD_DESTRUCTOR + /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H