]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Rename parameter to avoid darwin __weak qualifier
authorJonathan Wakely <jwakely@redhat.com>
Fri, 9 Sep 2022 20:03:58 +0000 (21:03 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 9 Sep 2022 20:11:14 +0000 (21:11 +0100)
libstdc++-v3/ChangeLog:

* include/bits/atomic_base.h (__atomic_impl::__compare_exchange):
Rename __weak to __is_weak.
* testsuite/17_intro/names.cc: Add __weak and __strong.

libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/testsuite/17_intro/names.cc

index 29315547aab5e5ba02023fa6013030fe03f35190..6ea3268fdf061a347dadb39c5ea424d388d161c5 100644 (file)
@@ -990,7 +990,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     template<typename _Tp>
       _GLIBCXX_ALWAYS_INLINE bool
       __compare_exchange(_Tp& __val, _Val<_Tp>& __e, _Val<_Tp>& __i,
-                        bool __weak, memory_order __s, memory_order __f) noexcept
+                        bool __is_weak,
+                        memory_order __s, memory_order __f) noexcept
       {
        __glibcxx_assert(__is_valid_cmpexch_failure_order(__f));
 
@@ -1005,7 +1006,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            __atomic_impl::__clear_padding(*__exp);
            if (__atomic_compare_exchange(std::__addressof(__val), __exp,
                                          __atomic_impl::__clear_padding(__i),
-                                         __weak, int(__s), int(__f)))
+                                         __is_weak, int(__s), int(__f)))
              return true;
            __builtin_memcpy(std::__addressof(__e), __exp, sizeof(_Vp));
            return false;
@@ -1014,7 +1015,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          return __atomic_compare_exchange(std::__addressof(__val),
                                           std::__addressof(__e),
                                           std::__addressof(__i),
-                                          __weak, int(__s), int(__f));
+                                          __is_weak, int(__s), int(__f));
       }
   } // namespace __atomic_impl
 
index ede2fe8caa745ddd4d0042c614ddacdecb58c317..86fb8f8999b1c5a5e237b8c8e71d96998397a470 100644 (file)
 // This clashes with newlib so don't use it.
 # define __lockable            cannot be used as an identifier
 
+#ifndef __APPLE__
+#define __weak   predefined qualifier on darwin
+#define __strong predefined qualifier on darwin
+#endif
 
 // Common template parameter names
 #define OutputIterator         OutputIterator is not a reserved name