aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@gcc.gnu.org>2009-02-18 07:35:36 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2009-02-18 07:35:36 +0000
commit9b3003d59044a53cddf432024579295ef5df1ca7 (patch)
treed70eeaeb64ce9289bfb6e172e223f4c4cd5f2910 /libstdc++-v3/include/std
parent0705d3f487d2b8c709c25051f55079a6e22cb3d0 (diff)
downloadgcc-9b3003d59044a53cddf432024579295ef5df1ca7.zip
gcc-9b3003d59044a53cddf432024579295ef5df1ca7.tar.gz
gcc-9b3003d59044a53cddf432024579295ef5df1ca7.tar.bz2
system_error (system_category): To system_category().
2009-02-17 Benjamin Kosnik <bkoz@redhat.com> * include/std/system_error (system_category): To system_category(). (generic_category): To generic_category. DR 890. * src/system_error.cc: Define. * include/bits/functexcept.h: Only one __throw_system_error. * src/functexcept.cc: Same. * include/std/mutex: Fixup for changes above. * testsuite/19_diagnostics/error_condition/cons/1.cc: Same. * testsuite/19_diagnostics/error_code/cons/1.cc: Same. * testsuite/19_diagnostics/system_error/cons-1.cc: Same. * config/abi/pre/gnu.ver: Clean up exports. From-SVN: r144259
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r--libstdc++-v3/include/std/mutex18
-rw-r--r--libstdc++-v3/include/std/system_error26
-rw-r--r--libstdc++-v3/include/std/thread2
3 files changed, 23 insertions, 23 deletions
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 22aff88..bdd5193 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -493,9 +493,9 @@ namespace std
lock()
{
if (!_M_device)
- __throw_system_error((int)errc::operation_not_permitted);
+ __throw_system_error(int(errc::operation_not_permitted));
else if (_M_owns)
- __throw_system_error((int)errc::resource_deadlock_would_occur);
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
else
{
_M_device->lock();
@@ -507,9 +507,9 @@ namespace std
try_lock()
{
if (!_M_device)
- __throw_system_error((int)errc::operation_not_permitted);
+ __throw_system_error(int(errc::operation_not_permitted));
else if (_M_owns)
- __throw_system_error((int)errc::resource_deadlock_would_occur);
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
else
{
_M_owns = _M_device->try_lock();
@@ -522,9 +522,9 @@ namespace std
try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime)
{
if (!_M_device)
- __throw_system_error((int)errc::operation_not_permitted);
+ __throw_system_error(int(errc::operation_not_permitted));
else if (_M_owns)
- __throw_system_error((int)errc::resource_deadlock_would_occur);
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
else
{
_M_owns = _M_device->try_lock_until(__atime);
@@ -537,9 +537,9 @@ namespace std
try_lock_for(const chrono::duration<_Rep, _Period>& __rtime)
{
if (!_M_device)
- __throw_system_error((int)errc::operation_not_permitted);
+ __throw_system_error(int(errc::operation_not_permitted));
else if (_M_owns)
- __throw_system_error((int)errc::resource_deadlock_would_occur);
+ __throw_system_error(int(errc::resource_deadlock_would_occur));
else
{
_M_owns = _M_device->try_lock_for(__rtime);
@@ -551,7 +551,7 @@ namespace std
unlock()
{
if (!_M_owns)
- __throw_system_error((int)errc::operation_not_permitted);
+ __throw_system_error(int(errc::operation_not_permitted));
else if (_M_device)
{
_M_device->unlock();
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error
index 4a93e5f..486c3e6 100644
--- a/libstdc++-v3/include/std/system_error
+++ b/libstdc++-v3/include/std/system_error
@@ -1,6 +1,6 @@
// <system_error> -*- C++ -*-
-// Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
//
// 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
@@ -110,15 +110,15 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
};
// DR 890.
- extern const error_category& system_category;
- extern const error_category& generic_category;
+ const error_category& system_category();
+ const error_category& generic_category();
/// error_code
// Implementation-specific error identification
struct error_code
{
error_code()
- : _M_value(0), _M_cat(&system_category) { }
+ : _M_value(0), _M_cat(&system_category()) { }
error_code(int __v, const error_category& __cat)
: _M_value(__v), _M_cat(&__cat) { }
@@ -126,7 +126,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _ErrorCodeEnum>
error_code(_ErrorCodeEnum __e,
typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value>::type* = 0)
- : _M_value(static_cast<int>(__e)), _M_cat(&generic_category)
+ : _M_value(static_cast<int>(__e)), _M_cat(&generic_category())
{ }
void
@@ -138,7 +138,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void
clear()
- { assign(0, system_category); }
+ { assign(0, system_category()); }
// DR 804.
template<typename _ErrorCodeEnum>
@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
error_code&>::type
operator=(_ErrorCodeEnum __e)
{
- assign(static_cast<int>(__e), generic_category);
+ assign(static_cast<int>(__e), generic_category());
return *this;
}
@@ -182,7 +182,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// 19.4.2.6 non-member functions
inline error_code
make_error_code(errc __e)
- { return error_code(static_cast<int>(__e), generic_category); }
+ { return error_code(static_cast<int>(__e), generic_category()); }
inline bool
operator<(const error_code& __lhs, const error_code& __rhs)
@@ -202,7 +202,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// Portable error identification
struct error_condition
{
- error_condition() : _M_value(0), _M_cat(&generic_category) { }
+ error_condition() : _M_value(0), _M_cat(&generic_category()) { }
error_condition(int __v, const error_category& __cat)
: _M_value(__v), _M_cat(&__cat) { }
@@ -211,7 +211,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
error_condition(_ErrorConditionEnum __e,
typename enable_if<is_error_condition_enum
<_ErrorConditionEnum>::value>::type* = 0)
- : _M_value(static_cast<int>(__e)), _M_cat(&generic_category) { }
+ : _M_value(static_cast<int>(__e)), _M_cat(&generic_category()) { }
void
assign(int __v, const error_category& __cat)
@@ -226,13 +226,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
<_ErrorConditionEnum>::value, error_condition&>::type
operator=(_ErrorConditionEnum __e)
{
- assign(static_cast<int>(__e), generic_category);
+ assign(static_cast<int>(__e), generic_category());
return *this;
}
void
clear()
- { assign(0, generic_category); }
+ { assign(0, generic_category()); }
// 19.4.3.4 observers
int
@@ -264,7 +264,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// 19.4.3.6 non-member functions
inline error_condition
make_error_condition(errc __e)
- { return error_condition(static_cast<int>(__e), generic_category); }
+ { return error_condition(static_cast<int>(__e), generic_category()); }
inline bool
operator<(const error_condition& __lhs, const error_condition& __rhs)
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread
index 8cd0e3a..8f00489 100644
--- a/libstdc++-v3/include/std/thread
+++ b/libstdc++-v3/include/std/thread
@@ -89,7 +89,7 @@ namespace std
};
// Simple base type that the templatized, derived class containing
- // an abitrary functor can be converted to and called.
+ // an arbitrary functor can be converted to and called.
struct _Impl_base
{
__shared_base_type _M_this_ptr;