Commit c284a126 by David Edelsohn Committed by David Edelsohn

atomicity.h: Use __gnu_cxx namespace.

        * config/os/aix/atomicity.h: Use __gnu_cxx namespace. Remove
        static, and inline keyworks.

From-SVN: r78574
parent b6b979d4
2004-02-27 David Edelsohn <edelsohn@gnu.org>
* config/os/aix/atomicity.h: Use __gnu_cxx namespace. Remove
static, and inline keyworks.
2004-02-27 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::_M_extract_float,
......
// Low-level functions for atomic operations: AIX version -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
......@@ -27,33 +27,35 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _BITS_ATOMICITY_H
#define _BITS_ATOMICITY_H 1
#include <bits/atomicity.h>
/* We cannot use the cpu/powerpc/bits/atomicity.h inline assembly
definitions for these operations since they depend on operations
that are not available on the original POWER architecture. AIX
still runs on the POWER architecture, so it would be incorrect to
assume the existence of these instructions. */
assume the existence of these instructions.
/* This should match the type pointed to by atomic_p in
<sys/atomic_op.h>. */
typedef int _Atomic_word;
The definition of _Atomic_word must match the type pointed to by
atomic_p in <sys/atomic_op.h>. */
#include <sys/atomic_op.h>
static inline int
__attribute__ ((__unused__))
__exchange_and_add (atomic_p __mem, int __val)
extern "C"
{
return fetch_and_add (__mem, __val);
#include <sys/atomic_op.h>
}
static inline void
__attribute__ ((__unused__))
__atomic_add (atomic_p __mem, int __val)
namespace __gnu_cxx
{
(void) fetch_and_add (__mem, __val);
}
#endif /* atomicity.h */
_Atomic_word
__attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word* __mem, int __val)
{
return ::fetch_and_add (const_cast<atomic_p>(__mem), __val);
}
void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
(void) ::fetch_and_add (const_cast<atomic_p>(__mem), __val);
}
} // namespace __gnu_cxx
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment