# include "standard_ao_double_t.h"
#endif
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val,
AO_t new_val);
#undef AO_HAVE_store_full
#define AO_store_full(addr, val) AO_store_full_emulation(addr, val)
#define AO_HAVE_store_full
+
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
#elif defined(AO_WEAK_DOUBLE_CAS_EMULATION)
# include "../standard_ao_double_t.h"
+# ifdef __cplusplus
+ extern "C" {
+# endif
+
/* This one provides spinlock based emulation of CAS implemented in */
/* atomic_ops.c. We probably do not want to do this here, since it */
/* is not atomic with respect to other kinds of updates of *addr. */
AO_t old_val1, AO_t old_val2,
AO_t new_val1, AO_t new_val2);
+# ifdef __cplusplus
+ } /* extern "C" */
+# endif
+
AO_INLINE int
AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
AO_t old_val1, AO_t old_val2,
/* This is not necessarily compatible with the native */
/* implementation. But those can't be safely mixed anyway. */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
/* We define only the full barrier variants, and count on the */
/* generalization section below to fill in the rest. */
extern pthread_mutex_t AO_pt_lock;
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
+
AO_INLINE void
AO_nop_full(void)
{
LONG __cdecl _InterlockedCompareExchange(LONG volatile *,
LONG /* Exchange */, LONG /* Comp */);
# ifdef __cplusplus
- }
+ } /* extern "C" */
# endif
# endif /* _MSC_VER < 1400 */
/* Test_and_set location is just a byte. */
#include "../test_and_set_t_is_char.h"
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
extern AO_TS_VAL_t
AO_test_and_set_full(volatile AO_TS_t *addr);
/* Implemented in separate .S file, for now. */
#define AO_HAVE_test_and_set_full
/* TODO: Like the gcc version, extend this for V8 and V9. */
+
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
#include <stddef.h> /* for size_t */
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
#ifdef AO_STACK_IS_LOCK_FREE
# define AO_MALLOC_IS_LOCK_FREE
#endif
/* Allow use of mmap to grow the heap. No-op on some platforms. */
void AO_malloc_enable_mmap(void);
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
+
#endif /* !AO_MALLOC_H */
#include "atomic_ops.h"
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
#ifdef AO_USE_ALMOST_LOCK_FREE
/* Use the almost-non-blocking implementation regardless of the */
/* double-word CAS availability. */
#ifndef AO_HAVE_double_t
/* Can happen if we're using CAS emulation, since we don't want to */
/* force that here, in case other atomic_ops clients don't want it. */
+# ifdef __cplusplus
+ } /* extern "C" */
+# endif
# include "atomic_ops/sysdeps/standard_ao_double_t.h"
+# ifdef __cplusplus
+ extern "C" {
+# endif
#endif
typedef volatile AO_double_t AO_stack_t;
# define AO_HAVE_stack_pop
#endif
+#ifdef __cplusplus
+ } /* extern "C" */
+#endif
+
#endif /* !AO_STACK_H */
|| defined(AO_USE_NO_SIGNALS) || defined(AO_USE_WIN32_PTHREADS)) \
&& defined(AO_TEST_EMULATION)
+# ifdef __cplusplus
+ extern "C" {
+# endif
+
void AO_store_full_emulation(volatile AO_t *addr, AO_t val);
AO_t AO_fetch_compare_and_swap_emulation(volatile AO_t *addr, AO_t old_val,
AO_t new_val);
AO_t new_val1, AO_t new_val2);
# endif
+# ifdef __cplusplus
+ } /* extern "C" */
+# endif
+
void test_atomic_emulation(void)
{
AO_t x;