Rest of trivial decorations
Jan Hubicka
hubicka@ucw.cz
Sat Apr 18 19:46:00 GMT 2009
> Jan Hubicka wrote:
> > Hi,
> > this patch adds trivial decorations found across the library. There are couple
> > things I broke out but in general this should be it.
> >
> > Tested on x86_64-linux, OK?
> >
> Ok, thanks. Make sure to not exceed 80 columns in the ChangeLog entries,
> please.
Thanks,
I however noticed one problem here. stdatomic.h can be included by C
code too. Does something like this look sane? Or do we want to invent
macro for throw() marker?
I think stdatomic.h is only case, other c headers contains to
functions.
Index: stdatomic.h
===================================================================
--- stdatomic.h (revision 146314)
+++ stdatomic.h (working copy)
@@ -119,26 +119,38 @@
typedef atomic_long atomic_ptrdiff_t;
+#if __cplusplus
// Accessor functions for base atomic_flag type.
bool
+ atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+
+ void
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+
+ void
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order) throw ();
+#else
+ // Accessor functions for base atomic_flag type.
+ bool
atomic_flag_test_and_set_explicit(volatile __atomic_flag_base*, memory_order);
+
+ void
+ atomic_flag_clear_explicit(volatile __atomic_flag_base*, memory_order);
+ void
+ __atomic_flag_wait_explicit(volatile __atomic_flag_base*, memory_order);
+#endif
+
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);
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);
- volatile __atomic_flag_base*
- __atomic_flag_for_address(const volatile void* __z) __attribute__((const));
+ _GLIBCXX_CONST volatile __atomic_flag_base*
+ __atomic_flag_for_address(const volatile void* __z) throw ();
// Implementation specific defines.
#define _ATOMIC_LOAD_(__a, __x) \
More information about the Libstdc++
mailing list