mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
hopefully fix strcasecmp and strnlen for those systems that don't hide them
This commit is contained in:
parent
4f6e61d68b
commit
d47533ad2e
3 changed files with 36 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue