This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Prevent macro expansion of mblen
Alexandre Oliva <aoliva@redhat.com> writes:
| On Dec 28, 2000, Gabriel Dos Reis <gdr@codesourcery.com> wrote:
|
| > | +#ifdef mblen
| > | + inline int (mblen)(const char *p, size_t l) { return mblen(p, l); }
| > | +#undef mblen
| > | +#else
| > | extern "C" int mblen(const char*, size_t);
| > | +#endif
|
| > "mblen" needs to have C linkage in all cases.
|
| Is it std::mblen that must have C linkage? I ask because ::mblen
| is declared and defined in the C library, and it does have C linkage.
We want all C-functions, whether there are shadowed (i.e. brought in
scope through <cxxx> or <xxx.h> headers) have C linkage -- this
ensures that those names ultimately refer to the same entities --
without exceptions for the reasons I exposed in another message.
| Isn't this inline function enough?
No.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com