public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Don't use gstdint.h anymore
@ 2022-10-20 12:56 Arsen Arsenović
  2022-10-20 13:08 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Arsen Arsenović @ 2022-10-20 12:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++, Arsen Arsenović

libstdc++-v3/ChangeLog:

	* configure.ac: Stop generating gstdint.h.
	* src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h.
---
Tested on x86_64-pc-linux-gnu.

 libstdc++-v3/configure.ac                            | 6 ------
 libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 9 +++++----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 81d914b434a..c5ec976c026 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO
 
 GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
 
-if test "$is_hosted" = yes; then
-# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to
-# use <stdint.h> instead of <gstdint.h>.
-GCC_HEADER_STDINT(include/gstdint.h)
-fi
-
 GLIBCXX_ENABLE_SYMVERS([yes])
 AC_SUBST(libtool_VERSION)
 
diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
index 5a0c5459088..2065eb517db 100644
--- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
+++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
@@ -22,10 +22,11 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-#include "gstdint.h"
 #include <atomic>
 #include <mutex>
 
+using guintptr_t = __UINTPTR_TYPE__;
+
 // XXX GLIBCXX_ABI Deprecated
 // gcc-4.7.0
 
@@ -119,13 +120,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   _GLIBCXX_CONST __atomic_flag_base*
   __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW
   {
-    uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
+    guintptr_t __u = reinterpret_cast<guintptr_t>(__z);
     __u += (__u >> 2) + (__u << 4);
     __u += (__u >> 7) + (__u << 5);
     __u += (__u >> 17) + (__u << 13);
-    if (sizeof(uintptr_t) > 4)
+    if (sizeof(guintptr_t) > 4)
       __u += (__u >> 31);
-    __u &= ~((~uintptr_t(0)) << LOGSIZE);
+    __u &= ~((~guintptr_t(0)) << LOGSIZE);
     return flag_table + __u;
   }
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libstdc++: Don't use gstdint.h anymore
  2022-10-20 12:56 [PATCH] libstdc++: Don't use gstdint.h anymore Arsen Arsenović
@ 2022-10-20 13:08 ` Jonathan Wakely
  2022-10-20 14:20   ` [PATCH v2] " Arsen Arsenović
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2022-10-20 13:08 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches, libstdc++

On Thu, 20 Oct 2022 at 13:58, Arsen Arsenović via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> libstdc++-v3/ChangeLog:
>
>         * configure.ac: Stop generating gstdint.h.
>         * src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h.
> ---
> Tested on x86_64-pc-linux-gnu.
>
>  libstdc++-v3/configure.ac                            | 6 ------
>  libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 9 +++++----
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
> index 81d914b434a..c5ec976c026 100644
> --- a/libstdc++-v3/configure.ac
> +++ b/libstdc++-v3/configure.ac
> @@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO
>
>  GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
>
> -if test "$is_hosted" = yes; then
> -# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to
> -# use <stdint.h> instead of <gstdint.h>.
> -GCC_HEADER_STDINT(include/gstdint.h)
> -fi
> -

Yes, I said in r12-6409-g68c2e9e9234cb3 that removing that could wait
for stage 1, so let's do it now.

>  GLIBCXX_ENABLE_SYMVERS([yes])
>  AC_SUBST(libtool_VERSION)
>
> diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
> index 5a0c5459088..2065eb517db 100644
> --- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
> +++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
> @@ -22,10 +22,11 @@
>  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  // <http://www.gnu.org/licenses/>.
>
> -#include "gstdint.h"
>  #include <atomic>
>  #include <mutex>
>
> +using guintptr_t = __UINTPTR_TYPE__;

I think this should be local in the only function that uses it.

> +
>  // XXX GLIBCXX_ABI Deprecated
>  // gcc-4.7.0
>
> @@ -119,13 +120,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>    _GLIBCXX_CONST __atomic_flag_base*
>    __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW
>    {
> -    uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
> +    guintptr_t __u = reinterpret_cast<guintptr_t>(__z);
>      __u += (__u >> 2) + (__u << 4);
>      __u += (__u >> 7) + (__u << 5);
>      __u += (__u >> 17) + (__u << 13);
> -    if (sizeof(uintptr_t) > 4)
> +    if (sizeof(guintptr_t) > 4)
>        __u += (__u >> 31);
> -    __u &= ~((~uintptr_t(0)) << LOGSIZE);
> +    __u &= ~((~guintptr_t(0)) << LOGSIZE);
>      return flag_table + __u;
>    }
>
> --
> 2.38.1
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] libstdc++: Don't use gstdint.h anymore
  2022-10-20 13:08 ` Jonathan Wakely
@ 2022-10-20 14:20   ` Arsen Arsenović
  2022-10-28 14:55     ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Arsen Arsenović @ 2022-10-20 14:20 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++, Arsen Arsenović

libstdc++-v3/ChangeLog:

	* configure.ac: Stop generating gstdint.h.
	* src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h.
---

> > +using guintptr_t = __UINTPTR_TYPE__;
> 
> I think this should be local in the only function that uses it.
Sure.

Tested on x86_64-pc-linux-gnu.

 libstdc++-v3/configure.ac                            | 6 ------
 libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 8 ++++----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 81d914b434a..c5ec976c026 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO
 
 GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
 
-if test "$is_hosted" = yes; then
-# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to
-# use <stdint.h> instead of <gstdint.h>.
-GCC_HEADER_STDINT(include/gstdint.h)
-fi
-
 GLIBCXX_ENABLE_SYMVERS([yes])
 AC_SUBST(libtool_VERSION)
 
diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
index 5a0c5459088..e21bd76245d 100644
--- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
+++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
@@ -22,7 +22,6 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-#include "gstdint.h"
 #include <atomic>
 #include <mutex>
 
@@ -119,13 +118,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   _GLIBCXX_CONST __atomic_flag_base*
   __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW
   {
-    uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
+    using guintptr_t = __UINTPTR_TYPE__;
+    guintptr_t __u = reinterpret_cast<guintptr_t>(__z);
     __u += (__u >> 2) + (__u << 4);
     __u += (__u >> 7) + (__u << 5);
     __u += (__u >> 17) + (__u << 13);
-    if (sizeof(uintptr_t) > 4)
+    if (sizeof(guintptr_t) > 4)
       __u += (__u >> 31);
-    __u &= ~((~uintptr_t(0)) << LOGSIZE);
+    __u &= ~((~guintptr_t(0)) << LOGSIZE);
     return flag_table + __u;
   }
 
-- 
2.38.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] libstdc++: Don't use gstdint.h anymore
  2022-10-20 14:20   ` [PATCH v2] " Arsen Arsenović
@ 2022-10-28 14:55     ` Jonathan Wakely
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2022-10-28 14:55 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: libstdc++, gcc-patches

On 20/10/22 16:20 +0200, Arsen Arsenović wrote:
>libstdc++-v3/ChangeLog:
>
>	* configure.ac: Stop generating gstdint.h.
>	* src/c++11/compatibility-atomic-c++0x.cc: Stop using gstdint.h.
>---
>
>> > +using guintptr_t = __UINTPTR_TYPE__;
>>
>> I think this should be local in the only function that uses it.
>Sure.
>
>Tested on x86_64-pc-linux-gnu.


Thanks, I'll test and push this.


> libstdc++-v3/configure.ac                            | 6 ------
> libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc | 8 ++++----
> 2 files changed, 4 insertions(+), 10 deletions(-)
>
>diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
>index 81d914b434a..c5ec976c026 100644
>--- a/libstdc++-v3/configure.ac
>+++ b/libstdc++-v3/configure.ac
>@@ -440,12 +440,6 @@ GCC_CHECK_UNWIND_GETIPINFO
>
> GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
>
>-if test "$is_hosted" = yes; then
>-# TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to
>-# use <stdint.h> instead of <gstdint.h>.
>-GCC_HEADER_STDINT(include/gstdint.h)
>-fi
>-
> GLIBCXX_ENABLE_SYMVERS([yes])
> AC_SUBST(libtool_VERSION)
>
>diff --git a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
>index 5a0c5459088..e21bd76245d 100644
>--- a/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
>+++ b/libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc
>@@ -22,7 +22,6 @@
> // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> // <http://www.gnu.org/licenses/>.
>
>-#include "gstdint.h"
> #include <atomic>
> #include <mutex>
>
>@@ -119,13 +118,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>   _GLIBCXX_CONST __atomic_flag_base*
>   __atomic_flag_for_address(const volatile void* __z) _GLIBCXX_NOTHROW
>   {
>-    uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
>+    using guintptr_t = __UINTPTR_TYPE__;
>+    guintptr_t __u = reinterpret_cast<guintptr_t>(__z);
>     __u += (__u >> 2) + (__u << 4);
>     __u += (__u >> 7) + (__u << 5);
>     __u += (__u >> 17) + (__u << 13);
>-    if (sizeof(uintptr_t) > 4)
>+    if (sizeof(guintptr_t) > 4)
>       __u += (__u >> 31);
>-    __u &= ~((~uintptr_t(0)) << LOGSIZE);
>+    __u &= ~((~guintptr_t(0)) << LOGSIZE);
>     return flag_table + __u;
>   }
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-28 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 12:56 [PATCH] libstdc++: Don't use gstdint.h anymore Arsen Arsenović
2022-10-20 13:08 ` Jonathan Wakely
2022-10-20 14:20   ` [PATCH v2] " Arsen Arsenović
2022-10-28 14:55     ` Jonathan Wakely

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).