This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
V3 PATCH: Undefine conflicting macros
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com
- Subject: V3 PATCH: Undefine conflicting macros
- From: Mark P Mitchell <mark at codesourcery dot com>
- Date: Thu, 2 Nov 2000 23:22:13 -0700 (MST)
- Reply-to: mark at codesourcery dot com
These headers need to follow the lead of wctype.h in undefining various
macros that have the same names as the functions being defined.
With this patch we have:
pass/fail results: 172/10
on IRIX 6.5. It looks like things are almost as good as on GNU/Linux,
which is very promising.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
Thu Nov 2 23:19:20 2000 Mark P Mitchell <mark@codesourcery.com>
* include/c/bits/std_cctype.h: Undefine macros that conflict
with function names defined in this file.
* include/c/bits/std_cstdio.h: Likewise.
Index: include/c/bits/std_cctype.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c/bits/std_cctype.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_cctype.h
*** std_cctype.h 2000/10/31 01:26:05 1.2
--- std_cctype.h 2000/11/03 06:14:07
***************
*** 41,46 ****
--- 41,62 ----
#pragma GCC system_header
#include_next <ctype.h>
+ // Get rid of those macros defined in <ctype.h> in lieu of real functions.
+ #undef isalnum
+ #undef isalpha
+ #undef isblank
+ #undef iscntrl
+ #undef isdigit
+ #undef isgraph
+ #undef islower
+ #undef isprint
+ #undef ispunct
+ #undef isspace
+ #undef isupper
+ #undef isxdigit
+ #undef tolower
+ #undef toupper
+
namespace std
{
extern "C" int isalnum(int __c);
Index: include/c/bits/std_cstdio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c/bits/std_cstdio.h,v
retrieving revision 1.2
diff -c -p -r1.2 std_cstdio.h
*** std_cstdio.h 2000/10/31 01:26:05 1.2
--- std_cstdio.h 2000/11/03 06:14:07
***************
*** 41,46 ****
--- 41,56 ----
#pragma GCC system_header
#include_next <stdio.h>
+ // Get rid of those macros defined in <stdio.h> in lieu of real functions.
+ #undef clearerr
+ #undef feof
+ #undef ferror
+ #undef fileno
+ #undef getc
+ #undef getchar
+ #undef putc
+ #undef putchar
+
namespace std
{
using ::FILE;