Commit 96abf600 by Jason Merrill

ropeimpl.h: Check __STL_PTHREADS instead of _PTHREADS.

	* ropeimpl.h: Check __STL_PTHREADS instead of _PTHREADS.
	* stl_alloc.h: Ditto.
	* stl_config.h: Ditto.
	* stl_rope.h: Ditto.
	* stl_config.h: include <_G_config.h> if __GNUG__ is defined.
	(__STL_PTHREADS): Defined if _PTHREADS is defined or
	__GLIBC__ >= 2.

From-SVN: r18138
parent 9766dbcf
Fri Feb 20 16:15:05 1998 H.J. Lu (hjl@gnu.org)
Jason Merrill <jason@yorick.cygnus.com>
* ropeimpl.h: Check __STL_PTHREADS instead of _PTHREADS.
* stl_alloc.h: Ditto.
* stl_config.h: Ditto.
* stl_rope.h: Ditto.
* stl_config.h: include <_G_config.h> if __GNUG__ is defined.
(__STL_PTHREADS): Defined if _PTHREADS is defined or
__GLIBC__ >= 2.
Tue Jan 27 12:01:25 1998 Jason Merrill <jason@yorick.cygnus.com>
* stl_algo.h (__lg): Fix for n == 0.
Sat Nov 8 00:45:17 1997 Jason Merrill <jason@yorick.cygnus.com> Sat Nov 8 00:45:17 1997 Jason Merrill <jason@yorick.cygnus.com>
* stl_hash_set.h (swap): Fix typo. * stl_hash_set.h (swap): Fix typo.
......
...@@ -1429,7 +1429,7 @@ rope<charT, Alloc>::rope(size_t n, charT c) ...@@ -1429,7 +1429,7 @@ rope<charT, Alloc>::rope(size_t n, charT c)
template<class charT, class Alloc> charT rope<charT,Alloc>::empty_c_str[1]; template<class charT, class Alloc> charT rope<charT,Alloc>::empty_c_str[1];
# ifdef _PTHREADS # ifdef __STL_PTHREADS
template<class charT, class Alloc> template<class charT, class Alloc>
pthread_mutex_t rope<charT,Alloc>::swap_lock = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t rope<charT,Alloc>::swap_lock = PTHREAD_MUTEX_INITIALIZER;
# endif # endif
......
...@@ -1004,7 +1004,7 @@ void __final_insertion_sort(RandomAccessIterator first, ...@@ -1004,7 +1004,7 @@ void __final_insertion_sort(RandomAccessIterator first,
template <class Size> template <class Size>
inline Size __lg(Size n) { inline Size __lg(Size n) {
Size k; Size k;
for (k = 0; n != 1; n >>= 1) ++k; for (k = 0; n > 1; n >>= 1) ++k;
return k; return k;
} }
......
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
# define __RESTRICT # define __RESTRICT
#endif #endif
#if !defined(_PTHREADS) && !defined(_NOTHREADS) \ #if !defined(__STL_PTHREADS) && !defined(_NOTHREADS) \
&& !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS) && !defined(__STL_SGI_THREADS) && !defined(__STL_WIN32THREADS)
# define _NOTHREADS # define _NOTHREADS
#endif #endif
# ifdef _PTHREADS # ifdef __STL_PTHREADS
// POSIX Threads // POSIX Threads
// This is dubious, since this is likely to be a high contention // This is dubious, since this is likely to be a high contention
// lock. Performance may not be adequate. // lock. Performance may not be adequate.
...@@ -357,7 +357,7 @@ private: ...@@ -357,7 +357,7 @@ private:
static inline void __unlock(volatile unsigned long *); static inline void __unlock(volatile unsigned long *);
# endif # endif
# ifdef _PTHREADS # ifdef __STL_PTHREADS
static pthread_mutex_t __node_allocator_lock; static pthread_mutex_t __node_allocator_lock;
# endif # endif
...@@ -558,7 +558,7 @@ __default_alloc_template<threads, inst>::reallocate(void *p, ...@@ -558,7 +558,7 @@ __default_alloc_template<threads, inst>::reallocate(void *p,
return(result); return(result);
} }
#ifdef _PTHREADS #ifdef __STL_PTHREADS
template <bool threads, int inst> template <bool threads, int inst>
pthread_mutex_t pthread_mutex_t
__default_alloc_template<threads, inst>::__node_allocator_lock __default_alloc_template<threads, inst>::__node_allocator_lock
......
...@@ -71,6 +71,10 @@ ...@@ -71,6 +71,10 @@
// (19) Defines __stl_assert either as a test or as a null macro, // (19) Defines __stl_assert either as a test or as a null macro,
// depending on whether or not __STL_ASSERTIONS is defined. // depending on whether or not __STL_ASSERTIONS is defined.
#ifdef _PTHREADS
# define __STL_PTHREADS
#endif
# if defined(__sgi) && !defined(__GNUC__) # if defined(__sgi) && !defined(__GNUC__)
# if !defined(_BOOL) # if !defined(_BOOL)
# define __STL_NEED_BOOL # define __STL_NEED_BOOL
...@@ -93,13 +97,14 @@ ...@@ -93,13 +97,14 @@
# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES) # if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
# define __STL_USE_NAMESPACES # define __STL_USE_NAMESPACES
# endif # endif
# if !defined(_NOTHREADS) && !defined(_PTHREADS) # if !defined(_NOTHREADS) && !defined(__STL_PTHREADS)
# define __STL_SGI_THREADS # define __STL_SGI_THREADS
# endif # endif
# endif # endif
# ifdef __GNUC__ # ifdef __GNUC__
# if 0 && (__GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)) # include <_G_config.h>
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __STL_STATIC_TEMPLATE_MEMBER_BUG # define __STL_STATIC_TEMPLATE_MEMBER_BUG
# define __STL_NEED_TYPENAME # define __STL_NEED_TYPENAME
# define __STL_NEED_EXPLICIT # define __STL_NEED_EXPLICIT
...@@ -109,6 +114,9 @@ ...@@ -109,6 +114,9 @@
# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS # define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_MEMBER_TEMPLATES # define __STL_MEMBER_TEMPLATES
# endif # endif
# if !defined(_NOTHREADS) && __GLIBC__ >= 2
# define __STL_PTHREADS
# endif
# ifdef __EXCEPTIONS # ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS # define __STL_USE_EXCEPTIONS
# endif # endif
......
...@@ -306,7 +306,7 @@ struct __rope_RopeBase { ...@@ -306,7 +306,7 @@ struct __rope_RopeBase {
{ {
return InterlockedDecrement(&refcount); return InterlockedDecrement(&refcount);
} }
# elif defined(_PTHREADS) # elif defined(__STL_PTHREADS)
// This should be portable, but performance is expected // This should be portable, but performance is expected
// to be quite awful. This really needs platform specific // to be quite awful. This really needs platform specific
// code. // code.
...@@ -939,7 +939,7 @@ class rope { ...@@ -939,7 +939,7 @@ class rope {
static cstrptr atomic_swap(cstrptr *p, cstrptr q) { static cstrptr atomic_swap(cstrptr *p, cstrptr q) {
return (cstrptr) InterlockedExchange((LPLONG)p, (LONG)q); return (cstrptr) InterlockedExchange((LPLONG)p, (LONG)q);
} }
# elif defined(_PTHREADS) # elif defined(__STL_PTHREADS)
// This should be portable, but performance is expected // This should be portable, but performance is expected
// to be quite awful. This really needs platform specific // to be quite awful. This really needs platform specific
// code. // code.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment