Prevent macro expansion of mblen

Benjamin Kosnik bkoz@redhat.com
Fri Dec 22 01:19:00 GMT 2000


> 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).

Hmm. Not ok to install. Of the options you presented, making an inline 
function that expands the macro and then undefs the define is preferred.

However, what might be best, which as not presented as an option is: if 
mblen is available as a function and 
as a macro, and which is used depends on a macro, then toggle that macro 
in config/os/irix/bits/os_defines.h so that you only get the function, 
and not the macro. 

Then undef the macro.

-benjamin


More information about the Libstdc++ mailing list