This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Prevent macro expansion of mblen
>>>>> "Gabriel" == Gabriel Dos Reis <gdr@codesourcery.com> writes:
> | > // file b.C part of a "C++"-program
> | > #include <cstdlib>
> | > extern "C" void f();
> | > void g() { f(); }
> |
> | > We need a way to make the call to f() work. Do you see what I'm
> | > trying to say?
> |
> | Nope. I really don't see why f() wouldn't work. It seems to me it
> | would work just fine.
> You get a link-time error if mblen() has a C++ linkage -- that is one
> of the reasons why we want all C-funtions to have C linkage.
Why? The C code would still call the C mblen. It wouldn't hurt for there
to also be an mblen with C++ linkage, though I don't think it would do much
good, either...
Jason