This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

V3 PATCH: Undefine conflicting macros



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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]