diff mbox series

libstdc++: Add include guard to simd-internal header

Message ID 3396847.CbtlEUcBR6@minbar
State New
Headers show
Series libstdc++: Add include guard to simd-internal header | expand

Commit Message

Matthias Kretz April 17, 2024, 8:16 a.m. UTC
This never showed up as an issue because it's an internal header and 
implicitly guarded by bits/simd.h.

OK for trunk? Any reason to backport?

--------------------- 8< ------------------

Signed-off-by: Matthias Kretz <m.kretz@gsi.de>

libstdc++-v3/ChangeLog:

	* include/experimental/bits/numeric_traits.h: Add include guard.
---
 libstdc++-v3/include/experimental/bits/numeric_traits.h | 4 ++++
 1 file changed, 4 insertions(+)

+#endif  // _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H

Comments

Jonathan Wakely April 17, 2024, 8:20 a.m. UTC | #1
On Wed, 17 Apr 2024 at 09:17, Matthias Kretz <m.kretz@gsi.de> wrote:
>
> This never showed up as an issue because it's an internal header and
> implicitly guarded by bits/simd.h.
>
> OK for trunk? Any reason to backport?

OK for trunk, I think it's worth backporting too.


>
> --------------------- 8< ------------------
>
> Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
>
> libstdc++-v3/ChangeLog:
>
>         * include/experimental/bits/numeric_traits.h: Add include guard.
> ---
>  libstdc++-v3/include/experimental/bits/numeric_traits.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/libstdc++-v3/include/experimental/bits/numeric_traits.h b/
> libstdc++-v3/include/experimental/bits/numeric_traits.h
> index b195de7c3db..8717f684d96 100644
> --- a/libstdc++-v3/include/experimental/bits/numeric_traits.h
> +++ b/libstdc++-v3/include/experimental/bits/numeric_traits.h
> @@ -22,6 +22,9 @@
>  // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>  // <http://www.gnu.org/licenses/>.
>
> +#ifndef _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H
> +#define _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H
> +
>  #include <type_traits>
>
>  namespace std {
> @@ -565,3 +568,4 @@ struct __has_iec559_behavior<__signaling_NaN, long
> double>
>  #endif // __FINITE_MATH_ONLY__
>
>  } // namespace std
> +#endif  // _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H
> --
> ──────────────────────────────────────────────────────────────────────────
>  Dr. Matthias Kretz                           https://mattkretz.github.io
>  GSI Helmholtz Centre for Heavy Ion Research               https://gsi.de
>  stdₓ::simd
> ──────────────────────────────────────────────────────────────────────────
>
diff mbox series

Patch

diff --git a/libstdc++-v3/include/experimental/bits/numeric_traits.h b/
libstdc++-v3/include/experimental/bits/numeric_traits.h
index b195de7c3db..8717f684d96 100644
--- a/libstdc++-v3/include/experimental/bits/numeric_traits.h
+++ b/libstdc++-v3/include/experimental/bits/numeric_traits.h
@@ -22,6 +22,9 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
+#ifndef _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H
+#define _GLIBCXX_EXPERIMENTAL_BITS_NUMERIC_TRAITS_H
+
 #include <type_traits>
 
 namespace std {
@@ -565,3 +568,4 @@  struct __has_iec559_behavior<__signaling_NaN, long 
double>
 #endif // __FINITE_MATH_ONLY__
 
 } // namespace std