public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: define and undefine always_inline macro wherever used
Date: Wed, 15 Nov 2023 05:54:44 +0000 (GMT)	[thread overview]
Message-ID: <20231115055444.7E7723858C78@sourceware.org> (raw)

https://gcc.gnu.org/g:a50a7f74ca532267c1c34f6fe8ae3611a595b38f

commit a50a7f74ca532267c1c34f6fe8ae3611a595b38f
Author: Alexandre Oliva <oliva@gnu.org>
Date:   Wed Nov 15 02:43:59 2023 -0300

    libstdc++: define and undefine always_inline macro wherever used

Diff:
---
 libstdc++-v3/include/bits/atomic_base.h    | 10 ++++++----
 libstdc++-v3/include/bits/atomic_futex.h   |  2 ++
 libstdc++-v3/include/bits/char_traits.h    |  8 +++++---
 libstdc++-v3/include/bits/semaphore_base.h |  7 +++++++
 libstdc++-v3/include/bits/stl_bvector.h    | 10 ++++++----
 libstdc++-v3/include/std/barrier           |  8 ++++++++
 libstdc++-v3/include/std/latch             |  7 +++++++
 7 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h
index 974872ad7a6..5562365c74c 100644
--- a/libstdc++-v3/include/bits/atomic_base.h
+++ b/libstdc++-v3/include/bits/atomic_base.h
@@ -42,14 +42,14 @@
 #include <bits/atomic_wait.h>
 #endif
 
-#ifndef _GLIBCXX_ALWAYS_INLINE
-#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
-#endif
-
 #define __glibcxx_want_atomic_value_initialization
 #define __glibcxx_want_atomic_flag_test
 #include <bits/version.h>
 
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -2067,4 +2067,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif
diff --git a/libstdc++-v3/include/bits/atomic_futex.h b/libstdc++-v3/include/bits/atomic_futex.h
index 6b37ce5ed12..0f370fa82de 100644
--- a/libstdc++-v3/include/bits/atomic_futex.h
+++ b/libstdc++-v3/include/bits/atomic_futex.h
@@ -357,4 +357,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif
diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h
index e9b4e84af99..e56818b254b 100644
--- a/libstdc++-v3/include/bits/char_traits.h
+++ b/libstdc++-v3/include/bits/char_traits.h
@@ -57,13 +57,13 @@
 # include <bits/stl_construct.h>
 #endif
 
+#define __glibcxx_want_constexpr_char_traits
+#include <bits/version.h>
+
 #ifndef _GLIBCXX_ALWAYS_INLINE
 # define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
 #endif
 
-#define __glibcxx_want_constexpr_char_traits
-#include <bits/version.h>
-
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1027,4 +1027,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
 
 #endif  // C++11
 
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif // _CHAR_TRAITS_H
diff --git a/libstdc++-v3/include/bits/semaphore_base.h b/libstdc++-v3/include/bits/semaphore_base.h
index 2b3c196040b..06a45f6876a 100644
--- a/libstdc++-v3/include/bits/semaphore_base.h
+++ b/libstdc++-v3/include/bits/semaphore_base.h
@@ -45,6 +45,10 @@
 # include <semaphore.h>	// sem_t, sem_init, sem_wait, sem_post etc.
 #endif
 
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -274,4 +278,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
+
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif // _GLIBCXX_SEMAPHORE_BASE_H
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 64f04c1f4f5..c1aa3396414 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -56,15 +56,15 @@
 #ifndef _STL_BVECTOR_H
 #define _STL_BVECTOR_H 1
 
-#ifndef _GLIBCXX_ALWAYS_INLINE
-#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
-#endif
-
 #if __cplusplus >= 201103L
 #include <initializer_list>
 #include <bits/functional_hash.h>
 #endif
 
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -1630,4 +1630,6 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif
diff --git a/libstdc++-v3/include/std/barrier b/libstdc++-v3/include/std/barrier
index 8e03a5820c6..5aaffa62086 100644
--- a/libstdc++-v3/include/std/barrier
+++ b/libstdc++-v3/include/std/barrier
@@ -52,6 +52,10 @@
 
 #include <array>
 
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -261,5 +265,9 @@ It looks different from literature pseudocode for two main reasons:
 
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif // __cpp_lib_barrier
+
 #endif // _GLIBCXX_BARRIER
diff --git a/libstdc++-v3/include/std/latch b/libstdc++-v3/include/std/latch
index 27cd80d7100..0548ddd67ae 100644
--- a/libstdc++-v3/include/std/latch
+++ b/libstdc++-v3/include/std/latch
@@ -40,6 +40,10 @@
 #include <bits/atomic_base.h>
 #include <ext/numeric_traits.h>
 
+#ifndef _GLIBCXX_ALWAYS_INLINE
+#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
@@ -90,5 +94,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   };
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
+
+#undef _GLIBCXX_ALWAYS_INLINE
+
 #endif // __cpp_lib_latch
 #endif // _GLIBCXX_LATCH

                 reply	other threads:[~2023-11-15  5:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231115055444.7E7723858C78@sourceware.org \
    --to=aoliva@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).