This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Rest of trivial decorations
> Paolo Carlini wrote:
> > I'm pretty sure the same problem occurred in libsupc++, for some
> > decorations added by Mark. Please look if you can find some
> > "inspiration" there ;)
> >
> On top of cxxabi.h, for example...
OK, thanks for pointer! Does this seem fine?
Honza
* c_compatibility/stdatomic.h (atomic_flag_test_and_set_explicit,
atomic_flag_clear_explicit, __atomic_flag_wait_explicit): Use
_GLIBCXX_NOTHROW.
* bits/c++config (_GLIBCXX_NOTHROW): New.
Index: c_compatibility/stdatomic.h
===================================================================
--- c_compatibility/stdatomic.h (revision 146323)
+++ c_compatibility/stdatomic.h (working copy)
@@ -121,21 +121,21 @@
// Accessor functions for base atomic_flag type.
bool
- atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline bool
atomic_flag_test_and_set(volatile __atomic_flag_base* __a)
{ return atomic_flag_test_and_set_explicit(__a, memory_order_seq_cst); }
void
- atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
inline void
atomic_flag_clear(volatile __atomic_flag_base* __a)
{ atomic_flag_clear_explicit(__a, memory_order_seq_cst); }
void
- __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) _GLIBCXX_NOTHROW;
_GLIBCXX_CONST volatile __atomic_flag_base*
__atomic_flag_for_address(const volatile void* __z) throw ();
Index: bits/c++config
===================================================================
--- bits/c++config (revision 146323)
+++ bits/c++config (working copy)
@@ -326,4 +326,12 @@
# define _GLIBCXX_NORETURN __attribute__ ((__noreturn__))
#endif
+#ifndef _GLIBCXX_NOTHROW
+# ifdef __cplusplus
+# define _GLIBCXX_NOTHROW throw()
+# else
+# define _GLIBCXX_NOTHROW __attribute__((nothrow))
+# endif
+#endif
+
// End of prewritten config; the discovered settings follow.