hopefully fix strcasecmp and strnlen for those systems that don't hide them

This commit is contained in:
Bill Currie 2002-02-06 19:06:05 +00:00
parent 4f6e61d68b
commit d47533ad2e
3 changed files with 36 additions and 6 deletions

View file

@ -91,13 +91,19 @@ extern int vsnprintf(char *s, size_t maxlen, const char *format, va_list arg);
#if !defined(strncaseequal)
# define strncaseequal(a,b,c) (strncasecmp (a, b, c) == 0)
#endif
// FIXME: glibc has strcasestr, but only declares it if __USE_GNU is defined
#if !defined(strcasestr)
#ifdef HAVE_STRCASESTR
# ifndef HAVE_STRCASESTR_PROTO
extern char *strcasestr (const char *__haystack, const char *__needle);
# endif
#else
# define strcasestr Q_strcasestr
# define need_qstring_h
#endif
// FIXME: same as above
#if !defined(strnlen)
#ifdef HAVE_STRNLEN
# ifndef HAVE_STRNLEN_PROTO
size_t strnlen (const char *str, size_t len);
# endif
#else
# define strnlen Q_strnlen
# define need_qstring_h
#endif