diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-02-03 23:44:53 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-02-03 23:44:53 +0000 |
commit | bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e (patch) | |
tree | e57495d04f52ab34d745a83ce9b9254363ad51c3 /libstdc++-v3/libsupc++ | |
parent | d0db89893f32405918a613be61232735d8356002 (diff) | |
download | gcc-bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e.zip gcc-bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e.tar.gz gcc-bc2631e0c645a95ba0e7bbc85c3ac3033ab49b3e.tar.bz2 |
re PR libstdc++/25191 (exception_defines.h #defines try/catch)
2009-02-03 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/25191
* libsupc++/exception_defines.h: Depending on __EXCEPTIONS,
deal consistently with __try and __catch too.
* src/localename.cc: Replace try -> __try, catch -> __catch.
* src/ios.cc: Likewise.
* src/locale.cc: Likewise.
* src/istream.cc: Likewise.
* src/thread.cc: Likewise.
* src/compatibility.cc: Likewise.
* src/bitmap_allocator.cc: Likewise.
* src/ios_init.cc: Likewise.
* include/debug/deque: Likewise.
* include/debug/list: Likewise.
* include/tr1_impl/hashtable: Likewise.
* include/std/bitset: Likewise.
* include/ext/pb_ds/detail/resize_policy/
hash_load_check_resize_trigger_imp.hpp: Likewise.
* include/ext/pb_ds/detail/resize_policy/
hash_standard_resize_policy_imp.hpp: Likewise.
* include/ext/pb_ds/detail/cc_hash_table_map_/
resize_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/cc_hash_table_map_/
constructor_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/pat_trie_/
split_join_branch_bag.hpp: Likewise.
* include/ext/pb_ds/detail/pat_trie_/
constructors_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/bin_search_tree_/
constructors_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/gp_hash_table_map_/
resize_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/gp_hash_table_map_/
constructor_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/binary_heap_/
constructors_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/binary_heap_/
erase_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/binary_heap_/
split_join_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/left_child_next_sibling_heap_/
constructors_destructor_fn_imps.hpp: Likewise.
* include/ext/pb_ds/detail/debug_map_base.hpp: Likewise.
* include/ext/pb_ds/detail/list_update_map_/
constructor_destructor_fn_imps.hpp: Likewise.
* include/ext/slist: Likewise.
* include/ext/memory: Likewise.
* include/ext/rc_string_base.h: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/ext/vstring.tcc: Likewise.
* include/ext/rope: Likewise.
* include/ext/sso_string_base.h: Likewise.
* include/bits/shared_ptr.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/locale_classes.tcc: Likewise.
* include/bits/locale_facets.tcc: Likewise.
* include/bits/locale_classes.h: Likewise.
* include/bits/forward_list.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/istream.tcc: Likewise.
* include/bits/stl_uninitialized.h: Likewise.
* include/bits/ostream.tcc: Likewise.
* include/bits/vector.tcc: Likewise.
* include/bits/stl_tempbuf.h: Likewise.
* include/bits/deque.tcc: Likewise.
* include/bits/basic_string.tcc: Likewise.
* include/bits/ostream_insert.h: Likewise.
* include/bits/locale_facets_nonio.tcc: Likewise.
* include/bits/stl_tree.h: Likewise.
* include/bits/fstream.tcc: Likewise.
* include/tr1/shared_ptr.h: Likewise.
* include/tr1/hypergeometric.tcc: Likewise.
* include/backward/hashtable.h: Likewise.
* libsupc++/exception_ptr.h: Likewise.
* libsupc++/eh_personality.cc: Likewise.
* libsupc++/eh_call.cc: Likewise.
* config/locale/gnu/monetary_members.cc: Likewise.
* config/locale/gnu/time_members.h: Likewise.
* config/locale/generic/time_members.h: Likewise.
From-SVN: r143913
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/eh_call.cc | 7 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_personality.cc | 11 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/exception_defines.h | 9 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/exception_ptr.h | 7 |
4 files changed, 20 insertions, 14 deletions
diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc index 497d862..1f64cfd 100644 --- a/libstdc++-v3/libsupc++/eh_call.cc +++ b/libstdc++-v3/libsupc++/eh_call.cc @@ -1,5 +1,6 @@ // -*- C++ -*- Helpers for calling unextected and terminate -// Copyright (C) 2001, 2002, 2003, 2008 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. // // This file is part of GCC. // @@ -108,14 +109,14 @@ __cxa_call_unexpected(void* exc_obj_in) } end_catch_protect_obj; - try + __try { if (foreign_exception) std::unexpected(); else __unexpected(unexpectedHandler); } - catch(...) + __catch(...) { /* See if the new exception matches the rtti list. */ if (foreign_exception) diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 12b54c1..177fe41 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -1,5 +1,6 @@ // -*- C++ -*- The GNU C++ exception personality routine. -// Copyright (C) 2001, 2002, 2003, 2006, 2008 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +// Free Software Foundation, Inc. // // This file is part of GCC. // @@ -664,9 +665,9 @@ PERSONALITY_FUNCTION (int version, std::terminate (); else if (handler_switch_value < 0) { - try + __try { std::unexpected (); } - catch(...) + __catch(...) { std::terminate (); } } } @@ -753,9 +754,9 @@ __cxa_call_unexpected (void *exc_obj_in) xh_terminate_handler = xh->terminateHandler; info.ttype_base = (_Unwind_Ptr) xh->catchTemp; - try + __try { __unexpected (xh->unexpectedHandler); } - catch(...) + __catch(...) { // Get the exception thrown from unexpected. diff --git a/libstdc++-v3/libsupc++/exception_defines.h b/libstdc++-v3/libsupc++/exception_defines.h index 446ed94..342806b 100644 --- a/libstdc++-v3/libsupc++/exception_defines.h +++ b/libstdc++-v3/libsupc++/exception_defines.h @@ -1,6 +1,7 @@ // -fno-exceptions Support -*- C++ -*- -// Copyright (C) 2001, 2003 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 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 @@ -40,11 +41,13 @@ #ifndef __EXCEPTIONS // Iff -fno-exceptions, transform error handling code to work without it. -# define try if (true) -# define catch(X) if (false) +# define __try if (true) +# define __catch(X) if (false) # define __throw_exception_again #else // Else proceed normally. +# define __try try +# define __catch(X) catch(X) # define __throw_exception_again throw #endif diff --git a/libstdc++-v3/libsupc++/exception_ptr.h b/libstdc++-v3/libsupc++/exception_ptr.h index 3f57b43..ae07db5 100644 --- a/libstdc++-v3/libsupc++/exception_ptr.h +++ b/libstdc++-v3/libsupc++/exception_ptr.h @@ -1,6 +1,6 @@ // Exception Handling support header (exception_ptr class) for -*- C++ -*- -// Copyright (C) 2008 Free Software Foundation +// Copyright (C) 2008, 2009 Free Software Foundation // // This file is part of GCC. // @@ -39,6 +39,7 @@ #pragma GCC visibility push(default) #include <bits/c++config.h> +#include <exception_defines.h> #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4) # error This platform does not support exception propagation. @@ -152,11 +153,11 @@ namespace std template <class _Ex> exception_ptr copy_exception(_Ex __ex) throw() { - try + __try { throw __ex; } - catch(...) + __catch(...) { return current_exception (); } |