This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


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

Re: __OPTIMIZE__ and str*() functions


> #ifndef strdup
> extern char *strdup (const char *s)
> #endif
> 
> or use autoconf tests to check if your header files provide the
> necessary prototypes.

Even this is not good enough in general, you need to use autoconf
tests.  There's a macro for this somewhere.

For instance, the header file might declare something like

extern char *strcpy __P ((char *__restrict __dest,
                          __const char *__restrict __src));

which may be incompatible with a plain

extern char *strcpy (char *dest, const char *src)

-- 
Geoffrey Keating <geoffk@ozemail.com.au>


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