Compile fix for mingw-w64

Don't build str(n)casecmp as functions if they are already defined by preprocessor

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31147 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2011-12-04 21:07:06 +00:00
parent 280d9074ab
commit 09f6556e22

View file

@ -2,6 +2,7 @@
#include <string.h>
#include <ctype.h>
#ifndef strcasecmp
int strcasecmp(const char *s1, const char *s2)
{
while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) {
@ -11,7 +12,9 @@ int strcasecmp(const char *s1, const char *s2)
return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
}
#endif
#ifndef strncasecmp
int strncasecmp(const char *s1, const char *s2, size_t n)
{
int d = 0;
@ -26,3 +29,4 @@ int strncasecmp(const char *s1, const char *s2, size_t n)
return d;
}
#endif