This is the mail archive of the 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]

Prevent macro expansion of mblen

IRIX 5.2's stdlib.h defines mblen as a macro.  I wonder whether we
should just #ifdef the declaration out in this case, or define
std::(mblen) as an inline function that expands the macro, or do as
the patch below (mblen is available as a function, despite the
existence of the macro).

Ok to install?

Index: libstdc++-v3/ChangeLog
from  Alexandre Oliva  <>
	* include/c_std/bits/std_cstdlib.h (mblen): Prevent macro
	expansion in declaration.

Index: libstdc++-v3/include/c_std/bits/std_cstdlib.h
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c_std/bits/std_cstdlib.h,v
retrieving revision 1.4
diff -u -p -r1.4 std_cstdlib.h
--- libstdc++-v3/include/c_std/bits/std_cstdlib.h 2000/12/22 00:27:01 1.4
+++ libstdc++-v3/include/c_std/bits/std_cstdlib.h 2000/12/22 09:07:10
@@ -85,7 +85,8 @@ namespace std 
   extern "C" long int labs(long int); 
   extern "C" div_t div(int, int); 
   extern "C" ldiv_t ldiv(long int, long int); 
-  extern "C" int mblen(const char*, size_t); 
+  /* The parentheses around mblen prevent macro expansion.  */
+  extern "C" int (mblen)(const char*, size_t);
   extern "C" int mbtowc(wchar_t*, const char*, size_t); 
   extern "C" int wctomb(char*, wchar_t); 
   extern "C" size_t mbstowcs(wchar_t*, const char*, size_t); 

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

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