public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix names.cc test failures on Windows
@ 2021-08-25 23:08 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-08-25 23:08 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

The Windows CRT headers define structs with members called f, x, y etc
so don't check those. There are also lots of unnecessary function
parameters in mingw headers using non-reserved names, e.g.

<time.h> uses p and z as parameters of mingw_gettimeofday
<inttypes.h> uses j as a parameter of imaxabs
<pthread.h> uses l, o and func as parameter names

Those should be fixed in the headers instead.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* testsuite/17_intro/names.cc: Adjust for Windows.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1297 bytes --]

commit f1a08f4d7839a0197a28ecd9ca6d4400769da3a7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Aug 25 22:27:22 2021

    libstdc++: Fix names.cc test failures on Windows
    
    The Windows CRT headers define structs with members called f, x, y etc
    so don't check those. There are also lots of unnecessary function
    parameters in mingw headers using non-reserved names, e.g.
    
    <time.h> uses p and z as parameters of mingw_gettimeofday
    <inttypes.h> uses j as a parameter of imaxabs
    <pthread.h> uses l, o and func as parameter names
    
    Those should be fixed in the headers instead.
    
    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/17_intro/names.cc: Adjust for Windows.

diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index 3cbe0d2da54..b0cc21d6cda 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -287,4 +287,14 @@
 
 #endif // __VXWORKS__
 
+#ifdef _WIN32
+#undef Value
+// <stdlib.h> defines _CRT_FLOAT::f
+#undef f
+// <stdlib.h> defines _CRT_DOUBLE::x and _LONGDOUBLE::x
+#undef x
+// <math.h> defines _complex::x and _complex::y
+#undef y
+#endif
+
 #include <bits/stdc++.h>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-25 23:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 23:08 [committed] libstdc++: Fix names.cc test failures on Windows 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).