Fix ODR violations in code using <ext/atomicity.h>
authorJonathan Wakely <jwakely@redhat.com>
Fri, 5 Jul 2019 16:10:47 +0000 (17:10 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 5 Jul 2019 16:10:47 +0000 (17:10 +0100)
commit0dc7adb03718396db1397be1ba1cb3482af957f7
tree2c840b225d725f2019e8a84928542405624c3c39
parent6e158c5fd534a1080dd013ed5d9d3fcc3fe838ff
Fix ODR violations in code using <ext/atomicity.h>

Because the inline versions of __exchange_and_add and __atomic_add are
also marked static, they cannot be used from templates or other inline
functions without ODR violations. This change gives them external
linkage, but adds the always_inline attribute.

     * include/ext/atomicity.h [_GLIBCXX_ATOMIC_BUILTINS] (__atomic_add)
     (__exchange_and_add): Replace static specifier with always_inline
     attribute.
     (__exchange_and_add_single, __atomic_add_single): Likewise.
     (__exchange_and_add_dispatch, __atomic_add_dispatch): Likewise. Also
     combine !__gthread_active_p() and !__GTHREADS branches.

From-SVN: r273144
libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/atomicity.h