re PR libstdc++/53270 (Error when bootstrapping gcc on hppa2.0-unknown-linux-gcc)
PR libstdc++/53270 * include/ext/concurrence.h (__mutex, __recursive_mutex, __cond): Use NSDMI in C++98 mode too. * include/ext/rope: Add system_header pragma. (_Refcount_Base, _Rope_RopeRep): Use NSDMI. (_Rope_RopeRep::~_Rope_RopeRep): Destroy mutex. From-SVN: r189553
This commit is contained in:
parent
b3ff651a97
commit
eb407c3432
|
@ -1,3 +1,12 @@
|
||||||
|
2012-07-16 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
|
PR libstdc++/53270
|
||||||
|
* include/ext/concurrence.h (__mutex, __recursive_mutex, __cond): Use
|
||||||
|
NSDMI in C++98 mode too.
|
||||||
|
* include/ext/rope: Add system_header pragma.
|
||||||
|
(_Refcount_Base, _Rope_RopeRep): Use NSDMI.
|
||||||
|
(_Rope_RopeRep::~_Rope_RopeRep): Destroy mutex.
|
||||||
|
|
||||||
2012-07-16 Jonathan Wakely <jwakely.gcc@gmail.com>
|
2012-07-16 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||||
|
|
||||||
PR libstdc++/53978
|
PR libstdc++/53978
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Support for concurrent programing -*- C++ -*-
|
// Support for concurrent programing -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
// Copyright (C) 2003-2012 Free Software Foundation, Inc.
|
||||||
// Free Software Foundation, Inc.
|
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
@ -143,8 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
class __mutex
|
class __mutex
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
#if __GTHREADS && defined __GTHREAD_MUTEX_INIT \
|
#if __GTHREADS && defined __GTHREAD_MUTEX_INIT
|
||||||
&& defined __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
|
__gthread_mutex_t _M_mutex = __GTHREAD_MUTEX_INIT;
|
||||||
#else
|
#else
|
||||||
__gthread_mutex_t _M_mutex;
|
__gthread_mutex_t _M_mutex;
|
||||||
|
@ -156,20 +154,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
public:
|
public:
|
||||||
__mutex()
|
__mutex()
|
||||||
{
|
{
|
||||||
#if __GTHREADS
|
#if __GTHREADS && ! defined __GTHREAD_MUTEX_INIT
|
||||||
if (__gthread_active_p())
|
if (__gthread_active_p())
|
||||||
{
|
|
||||||
#if defined __GTHREAD_MUTEX_INIT
|
|
||||||
# ifndef __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
|
|
||||||
_M_mutex = __tmp;
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
__GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
|
__GTHREAD_MUTEX_INIT_FUNCTION(&_M_mutex);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if __GTHREADS && ! defined __GTHREAD_MUTEX_INIT
|
#if __GTHREADS && ! defined __GTHREAD_MUTEX_INIT
|
||||||
~__mutex()
|
~__mutex()
|
||||||
|
@ -208,8 +197,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
class __recursive_mutex
|
class __recursive_mutex
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
#if __GTHREADS && defined __GTHREAD_RECURSIVE_MUTEX_INIT \
|
#if __GTHREADS && defined __GTHREAD_RECURSIVE_MUTEX_INIT
|
||||||
&& defined __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT;
|
__gthread_recursive_mutex_t _M_mutex = __GTHREAD_RECURSIVE_MUTEX_INIT;
|
||||||
#else
|
#else
|
||||||
__gthread_recursive_mutex_t _M_mutex;
|
__gthread_recursive_mutex_t _M_mutex;
|
||||||
|
@ -221,20 +209,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
public:
|
public:
|
||||||
__recursive_mutex()
|
__recursive_mutex()
|
||||||
{
|
{
|
||||||
#if __GTHREADS
|
#if __GTHREADS && ! defined __GTHREAD_RECURSIVE_MUTEX_INIT
|
||||||
if (__gthread_active_p())
|
if (__gthread_active_p())
|
||||||
{
|
|
||||||
#if defined __GTHREAD_RECURSIVE_MUTEX_INIT
|
|
||||||
# ifndef __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_recursive_mutex_t __tmp = __GTHREAD_RECURSIVE_MUTEX_INIT;
|
|
||||||
_M_mutex = __tmp;
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
|
__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION(&_M_mutex);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if __GTHREADS && ! defined __GTHREAD_RECURSIVE_MUTEX_INIT
|
#if __GTHREADS && ! defined __GTHREAD_RECURSIVE_MUTEX_INIT
|
||||||
~__recursive_mutex()
|
~__recursive_mutex()
|
||||||
|
@ -333,8 +312,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
class __cond
|
class __cond
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
#if __GTHREADS && defined __GTHREAD_COND_INIT \
|
#if __GTHREADS && defined __GTHREAD_COND_INIT
|
||||||
&& defined __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_cond_t _M_cond = __GTHREAD_COND_INIT;
|
__gthread_cond_t _M_cond = __GTHREAD_COND_INIT;
|
||||||
#else
|
#else
|
||||||
__gthread_cond_t _M_cond;
|
__gthread_cond_t _M_cond;
|
||||||
|
@ -346,20 +324,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
public:
|
public:
|
||||||
__cond()
|
__cond()
|
||||||
{
|
{
|
||||||
#if __GTHREADS
|
#if __GTHREADS && ! defined __GTHREAD_COND_INIT
|
||||||
if (__gthread_active_p())
|
if (__gthread_active_p())
|
||||||
{
|
|
||||||
#if defined __GTHREAD_COND_INIT
|
|
||||||
# ifndef __GXX_EXPERIMENTAL_CXX0X__
|
|
||||||
__gthread_cond_t __tmp = __GTHREAD_COND_INIT;
|
|
||||||
_M_cond = __tmp;
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
__GTHREAD_COND_INIT_FUNCTION(&_M_cond);
|
__GTHREAD_COND_INIT_FUNCTION(&_M_cond);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#if __GTHREADS && ! defined __GTHREAD_COND_INIT
|
#if __GTHREADS && ! defined __GTHREAD_COND_INIT
|
||||||
~__cond()
|
~__cond()
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// SGI's rope class -*- C++ -*-
|
// SGI's rope class -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
// Copyright (C) 2001-2012 Free Software Foundation, Inc.
|
||||||
// Free Software Foundation, Inc.
|
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
@ -44,6 +43,8 @@
|
||||||
#ifndef _ROPE
|
#ifndef _ROPE
|
||||||
#define _ROPE 1
|
#define _ROPE 1
|
||||||
|
|
||||||
|
#pragma GCC system_header
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <bits/stl_construct.h>
|
#include <bits/stl_construct.h>
|
||||||
|
@ -458,23 +459,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
volatile _RC_t _M_ref_count;
|
volatile _RC_t _M_ref_count;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
#if defined __GTHREAD_MUTEX_INIT && defined __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GTHREAD_MUTEX_INIT
|
||||||
__gthread_mutex_t _M_ref_count_lock = __GTHREAD_MUTEX_INIT;
|
__gthread_mutex_t _M_ref_count_lock = __GTHREAD_MUTEX_INIT;
|
||||||
#else
|
#else
|
||||||
__gthread_mutex_t _M_ref_count_lock;
|
__gthread_mutex_t _M_ref_count_lock;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_Refcount_Base(_RC_t __n) : _M_ref_count(__n), _M_ref_count_lock()
|
_Refcount_Base(_RC_t __n) : _M_ref_count(__n)
|
||||||
{
|
{
|
||||||
#ifdef __GTHREAD_MUTEX_INIT
|
#ifndef __GTHREAD_MUTEX_INIT
|
||||||
# ifndef __GXX_EXPERIMENTAL_CXX0X__
|
#ifdef __GTHREAD_MUTEX_INIT_FUNCTION
|
||||||
__gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
|
|
||||||
_M_ref_count_lock = __tmp;
|
|
||||||
# endif
|
|
||||||
#elif defined(__GTHREAD_MUTEX_INIT_FUNCTION)
|
|
||||||
__GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
|
__GTHREAD_MUTEX_INIT_FUNCTION (&_M_ref_count_lock);
|
||||||
#else
|
#else
|
||||||
#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
|
#error __GTHREAD_MUTEX_INIT or __GTHREAD_MUTEX_INIT_FUNCTION should be defined by gthr.h abstraction layer, report problem to libstdc++@gcc.gnu.org.
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -592,7 +590,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
bool _M_is_balanced:8;
|
bool _M_is_balanced:8;
|
||||||
unsigned char _M_depth;
|
unsigned char _M_depth;
|
||||||
__GC_CONST _CharT* _M_c_string;
|
__GC_CONST _CharT* _M_c_string;
|
||||||
|
#ifdef __GTHREAD_MUTEX_INIT
|
||||||
|
__gthread_mutex_t _M_c_string_lock = __GTHREAD_MUTEX_INIT;
|
||||||
|
#else
|
||||||
__gthread_mutex_t _M_c_string_lock;
|
__gthread_mutex_t _M_c_string_lock;
|
||||||
|
#endif
|
||||||
/* Flattened version of string, if needed. */
|
/* Flattened version of string, if needed. */
|
||||||
/* typically 0. */
|
/* typically 0. */
|
||||||
/* If it's not 0, then the memory is owned */
|
/* If it's not 0, then the memory is owned */
|
||||||
|
@ -613,13 +615,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
#endif
|
#endif
|
||||||
_M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
|
_M_tag(__t), _M_is_balanced(__b), _M_depth(__d), _M_c_string(0)
|
||||||
#ifdef __GTHREAD_MUTEX_INIT
|
#ifdef __GTHREAD_MUTEX_INIT
|
||||||
{
|
{ }
|
||||||
// Do not copy a POSIX/gthr mutex once in use. However, bits are bits.
|
|
||||||
__gthread_mutex_t __tmp = __GTHREAD_MUTEX_INIT;
|
|
||||||
_M_c_string_lock = __tmp;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
{ __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
|
{ __GTHREAD_MUTEX_INIT_FUNCTION (&_M_c_string_lock); }
|
||||||
|
~_Rope_RopeRep()
|
||||||
|
{ __gthread_mutex_destroy (&_M_c_string_lock); }
|
||||||
#endif
|
#endif
|
||||||
#ifdef __GC
|
#ifdef __GC
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue