* config/os/aix/atomicity.h: Use __gnu_cxx namespace. Remove
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 18:59:31 +0000 (18:59 +0000)
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Feb 2004 18:59:31 +0000 (18:59 +0000)
        static, and inline keyworks.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78574 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 343c898..a99ccea 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 af4fa5a..dad8aae 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