[v2,2/4] libstdc++: Add header mdspan to the build-system.

Message ID 20250415084038.322962-3-luc.grosheintz@gmail.com
State New
Headers
Series Implement extents from the mdspan header. |

Commit Message

Luc Grosheintz April 15, 2025, 8:40 a.m. UTC
  Creates a nearly empty header mdspan and adds it to the build-system and
Doxygen config file.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in: Add <mdspan>.
	* include/Makefile.am: Ditto.
	* include/Makefile.in: Ditto.
	* include/precompiled/stdc++.h: Ditto.
	* include/std/mdspan: New file.

Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
---
 libstdc++-v3/doc/doxygen/user.cfg.in      |  1 +
 libstdc++-v3/include/Makefile.am          |  1 +
 libstdc++-v3/include/Makefile.in          |  1 +
 libstdc++-v3/include/precompiled/stdc++.h |  1 +
 libstdc++-v3/include/std/mdspan           | 48 +++++++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 libstdc++-v3/include/std/mdspan
  

Comments

Tomasz Kaminski April 15, 2025, 9:20 a.m. UTC | #1
On Tue, Apr 15, 2025 at 10:43 AM Luc Grosheintz <luc.grosheintz@gmail.com>
wrote:

> Creates a nearly empty header mdspan and adds it to the build-system and
> Doxygen config file.
>
> libstdc++-v3/ChangeLog:
>
>         * doc/doxygen/user.cfg.in: Add <mdspan>.
>         * include/Makefile.am: Ditto.
>         * include/Makefile.in: Ditto.
>         * include/precompiled/stdc++.h: Ditto.
>         * include/std/mdspan: New file.
>
> Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
>
LGTM, as mentioned before, a separate approval from merging is needed.

> ---
>  libstdc++-v3/doc/doxygen/user.cfg.in      |  1 +
>  libstdc++-v3/include/Makefile.am          |  1 +
>  libstdc++-v3/include/Makefile.in          |  1 +
>  libstdc++-v3/include/precompiled/stdc++.h |  1 +
>  libstdc++-v3/include/std/mdspan           | 48 +++++++++++++++++++++++
>  5 files changed, 52 insertions(+)
>  create mode 100644 libstdc++-v3/include/std/mdspan
>
> diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in
> b/libstdc++-v3/doc/doxygen/user.cfg.in
> index 19ae67a67ba..e926c6707f6 100644
> --- a/libstdc++-v3/doc/doxygen/user.cfg.in
> +++ b/libstdc++-v3/doc/doxygen/user.cfg.in
> @@ -880,6 +880,7 @@ INPUT                  = @srcdir@/doc/doxygen/doxygroups.cc
> \
>                           include/list \
>                           include/locale \
>                           include/map \
> +                         include/mdspan \
>                           include/memory \
>                           include/memory_resource \
>                           include/mutex \
> diff --git a/libstdc++-v3/include/Makefile.am
> b/libstdc++-v3/include/Makefile.am
> index 537774c2668..1140fa0dffd 100644
> --- a/libstdc++-v3/include/Makefile.am
> +++ b/libstdc++-v3/include/Makefile.am
> @@ -38,6 +38,7 @@ std_freestanding = \
>         ${std_srcdir}/generator \
>         ${std_srcdir}/iterator \
>         ${std_srcdir}/limits \
> +       ${std_srcdir}/mdspan \
>         ${std_srcdir}/memory \
>         ${std_srcdir}/numbers \
>         ${std_srcdir}/numeric \
> diff --git a/libstdc++-v3/include/Makefile.in
> b/libstdc++-v3/include/Makefile.in
> index 7b96b2207f8..c96e981acd6 100644
> --- a/libstdc++-v3/include/Makefile.in
> +++ b/libstdc++-v3/include/Makefile.in
> @@ -396,6 +396,7 @@ std_freestanding = \
>         ${std_srcdir}/generator \
>         ${std_srcdir}/iterator \
>         ${std_srcdir}/limits \
> +       ${std_srcdir}/mdspan \
>         ${std_srcdir}/memory \
>         ${std_srcdir}/numbers \
>         ${std_srcdir}/numeric \
> diff --git a/libstdc++-v3/include/precompiled/stdc++.h
> b/libstdc++-v3/include/precompiled/stdc++.h
> index f4b312d9e47..e7d89c92704 100644
> --- a/libstdc++-v3/include/precompiled/stdc++.h
> +++ b/libstdc++-v3/include/precompiled/stdc++.h
> @@ -228,6 +228,7 @@
>  #include <flat_map>
>  #include <flat_set>
>  #include <generator>
> +#include <mdspan>
>  #include <print>
>  #include <spanstream>
>  #include <stacktrace>
> diff --git a/libstdc++-v3/include/std/mdspan
> b/libstdc++-v3/include/std/mdspan
> new file mode 100644
> index 00000000000..4094a416d1e
> --- /dev/null
> +++ b/libstdc++-v3/include/std/mdspan
> @@ -0,0 +1,48 @@
> +// <mdspan> -*- C++ -*-
> +
> +// Copyright (C) 2025 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
> +// terms of the GNU General Public License as published by the
> +// Free Software Foundation; either version 3, or (at your option)
> +// any later version.
> +
> +// This library is distributed in the hope that it will be useful,
> +// but WITHOUT ANY WARRANTY; without even the implied warranty of
> +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +// GNU General Public License for more details.
> +
> +// Under Section 7 of GPL version 3, you are granted additional
> +// permissions described in the GCC Runtime Library Exception, version
> +// 3.1, as published by the Free Software Foundation.
> +
> +// You should have received a copy of the GNU General Public License and
> +// a copy of the GCC Runtime Library Exception along with this program;
> +// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> +// <http://www.gnu.org/licenses/>.
> +
> +/** @file mdspan
> + *  This is a Standard C++ Library header.
> + */
> +
> +#ifndef _GLIBCXX_MDSPAN
> +#define _GLIBCXX_MDSPAN 1
> +
> +#ifdef _GLIBCXX_SYSHDR
> +#pragma GCC system_header
> +#endif
> +
> +#define __glibcxx_want_mdspan
> +#include <bits/version.h>
> +
> +#ifdef __glibcxx_mdspan
> +
> +namespace std _GLIBCXX_VISIBILITY(default)
> +{
> +_GLIBCXX_BEGIN_NAMESPACE_VERSION
> +
> +_GLIBCXX_END_NAMESPACE_VERSION
> +}
> +#endif
> +#endif
> --
> 2.48.1
>
>
  

Patch

diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in
index 19ae67a67ba..e926c6707f6 100644
--- a/libstdc++-v3/doc/doxygen/user.cfg.in
+++ b/libstdc++-v3/doc/doxygen/user.cfg.in
@@ -880,6 +880,7 @@  INPUT                  = @srcdir@/doc/doxygen/doxygroups.cc \
                          include/list \
                          include/locale \
                          include/map \
+                         include/mdspan \
                          include/memory \
                          include/memory_resource \
                          include/mutex \
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 537774c2668..1140fa0dffd 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -38,6 +38,7 @@  std_freestanding = \
 	${std_srcdir}/generator \
 	${std_srcdir}/iterator \
 	${std_srcdir}/limits \
+	${std_srcdir}/mdspan \
 	${std_srcdir}/memory \
 	${std_srcdir}/numbers \
 	${std_srcdir}/numeric \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 7b96b2207f8..c96e981acd6 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -396,6 +396,7 @@  std_freestanding = \
 	${std_srcdir}/generator \
 	${std_srcdir}/iterator \
 	${std_srcdir}/limits \
+	${std_srcdir}/mdspan \
 	${std_srcdir}/memory \
 	${std_srcdir}/numbers \
 	${std_srcdir}/numeric \
diff --git a/libstdc++-v3/include/precompiled/stdc++.h b/libstdc++-v3/include/precompiled/stdc++.h
index f4b312d9e47..e7d89c92704 100644
--- a/libstdc++-v3/include/precompiled/stdc++.h
+++ b/libstdc++-v3/include/precompiled/stdc++.h
@@ -228,6 +228,7 @@ 
 #include <flat_map>
 #include <flat_set>
 #include <generator>
+#include <mdspan>
 #include <print>
 #include <spanstream>
 #include <stacktrace>
diff --git a/libstdc++-v3/include/std/mdspan b/libstdc++-v3/include/std/mdspan
new file mode 100644
index 00000000000..4094a416d1e
--- /dev/null
+++ b/libstdc++-v3/include/std/mdspan
@@ -0,0 +1,48 @@ 
+// <mdspan> -*- C++ -*-
+
+// Copyright (C) 2025 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file mdspan
+ *  This is a Standard C++ Library header.
+ */
+
+#ifndef _GLIBCXX_MDSPAN
+#define _GLIBCXX_MDSPAN 1
+
+#ifdef _GLIBCXX_SYSHDR
+#pragma GCC system_header
+#endif
+
+#define __glibcxx_want_mdspan
+#include <bits/version.h>
+
+#ifdef __glibcxx_mdspan
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+_GLIBCXX_END_NAMESPACE_VERSION
+}
+#endif
+#endif