// xxatomic internal header
// NOTE: no include guard

// Used by header <atomic> to define atomic types for integral types and
// addresses.

 #if defined(__ghs)
  #pragma ghs start_cxx_lib_header
  #pragma ghs startdata
  #if defined(__ghs_max_pack_value)
   #pragma pack (push, __ghs_max_pack_value)
  #endif /* defined(__ghs_max_pack_value) */
 #endif /* defined(__ghs) */

template<>
        _Inline void atomic_init(volatile atomic<_ITYPE> *_Atom,
                _ITYPE _Value) _NOEXCEPT
        {
        _Atom->_Init(_Value);
        }

template<>
        _Inline void atomic_init(atomic<_ITYPE> *_Atom,
                _ITYPE _Value) _NOEXCEPT
        {
        _Atom->_Init(_Value);
        }

template<>
	_Inline _ITYPE atomic_fetch_add(
		volatile atomic<_ITYPE> *_Atom,
			_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_add(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_add_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_add_explicit(atomic<_ITYPE> *_Atom, _ITYPE _Value,
						 memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_sub(
		volatile atomic<_ITYPE> *_Atom,
			_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_sub(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_sub_explicit(
	volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
		memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_sub_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_and(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_and(
		atomic<_ITYPE> *_Atom, _ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_and_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_and_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_or(volatile atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_or(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_or_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_or_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_xor(volatile atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_xor(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value));
	}

template<>
	_Inline _ITYPE atomic_fetch_xor_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value, _Order));
	}

template<>
	_Inline _ITYPE atomic_fetch_xor_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value, _Order));
	}

#ifdef _ATOMIC_NO_TEMPLATE_OVERLOADS
        _Inline void atomic_init(volatile atomic<_ITYPE> *_Atom,
                _ITYPE _Value) _NOEXCEPT
        {
        _Atom->_Init(_Value);
        }

        _Inline void atomic_init(atomic<_ITYPE> *_Atom,
                _ITYPE _Value) _NOEXCEPT
        {
        _Atom->_Init(_Value);
        }

	_Inline _ITYPE atomic_fetch_add(
		volatile atomic<_ITYPE> *_Atom,
			_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value));
	}

	_Inline _ITYPE atomic_fetch_add(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value));
	}

	_Inline _ITYPE atomic_fetch_add_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_add_explicit(atomic<_ITYPE> *_Atom, _ITYPE _Value,
						 memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_add(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_sub(
		volatile atomic<_ITYPE> *_Atom,
			_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value));
	}

	_Inline _ITYPE atomic_fetch_sub(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value));
	}

	_Inline _ITYPE atomic_fetch_sub_explicit(
	volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
		memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_sub_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_sub(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_and(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value));
	}

	_Inline _ITYPE atomic_fetch_and(
		atomic<_ITYPE> *_Atom, _ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value));
	}

	_Inline _ITYPE atomic_fetch_and_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_and_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_and(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_or(volatile atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value));
	}

	_Inline _ITYPE atomic_fetch_or(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value));
	}

	_Inline _ITYPE atomic_fetch_or_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_or_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_or(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_xor(volatile atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value));
	}

	_Inline _ITYPE atomic_fetch_xor(atomic<_ITYPE> *_Atom,
		_ITYPE _Value) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value));
	}

	_Inline _ITYPE atomic_fetch_xor_explicit(
		volatile atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value, _Order));
	}

	_Inline _ITYPE atomic_fetch_xor_explicit(
		atomic<_ITYPE> *_Atom, _ITYPE _Value,
			memory_order _Order) _NOEXCEPT
	{
	return (_Atom->fetch_xor(_Value, _Order));
	}

#endif /* _ATOMIC_NO_TEMPLATE_OVERLOADS */

#undef _ATOMIC_NO_TEMPLATE_OVERLOADS
#undef _ITYPE

 #if defined(__ghs)
  #if defined(__ghs_max_pack_value)
   #pragma pack(pop)
  #endif /* defined(__ghs_max_pack_value) */
  #pragma ghs enddata
  #pragma ghs end_cxx_lib_header
 #endif /* defined(__ghs) */

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.44:0693 */
