This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Prevent macro expansion of mblen
- To: libstdc++ at gcc dot gnu dot org
- Subject: Prevent macro expansion of mblen
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 22 Dec 2000 07:11:12 -0200
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
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 <aoliva@redhat.com>
* 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 http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me