]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
atomicity.h: Use __gnu_cxx namespace.
authorDavid Edelsohn <edelsohn@gnu.org>
Fri, 27 Feb 2004 18:59:31 +0000 (18:59 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Fri, 27 Feb 2004 18:59:31 +0000 (13:59 -0500)
        * config/os/aix/atomicity.h: Use __gnu_cxx namespace. Remove
        static, and inline keyworks.

From-SVN: r78574

libstdc++-v3/ChangeLog
libstdc++-v3/config/os/aix/atomicity.h

index 343c898f8c9edab04e48deebd010ab43526599c4..a99ccea6bb35e9ed46c81e70fbec7a7b1b675f2d 100644 (file)
@@ -1,3 +1,8 @@
+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,
index af4fa5a808cfabddfe06a0085a4e513ea52fac3c..dad8aae0932dd59b9038f10024e4804ecbb05154 100644 (file)
@@ -1,6 +1,6 @@
 // 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
 // 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