/*
* Copyright (c) 2017 Ivan Maidanski
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
*
* Permission is hereby granted to use or copy this program
* for any purpose, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
/* This is a private GC header which provides an implementation of */
/* libatomic_ops subset primitives sufficient for GC assuming that GCC */
/* atomic intrinsics are available (and have correct implementation). */
/* This is enabled by defining GC_BUILTIN_ATOMIC macro. Otherwise, */
/* libatomic_ops library is used to define the primitives. */
# ifndef NO_LOCKFREE_AO_OR
/* __atomic_or_fetch is assumed to be lock-free. */
# define HAVE_LOCKFREE_AO_OR 1
# endif
#else
/* Fallback to libatomic_ops. */
# include "atomic_ops.h"
/* AO_compiler_barrier, AO_load and AO_store should be defined for */
/* all targets; the rest of the primitives are guaranteed to exist */
/* only if AO_REQUIRE_CAS is defined (or if the corresponding */
/* AO_HAVE_x macro is defined). x86/x64 targets have AO_nop_full, */
/* AO_load_acquire, AO_store_release, at least. */
# if (!defined(AO_HAVE_load) || !defined(AO_HAVE_store)) && !defined(CPPCHECK)
# error AO_load or AO_store is missing; probably old version of atomic_ops
# endif