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:
parent
280d9074ab
commit
09f6556e22
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifndef strcasecmp
|
||||||
int strcasecmp(const char *s1, const char *s2)
|
int strcasecmp(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
while (*s1 != '\0' && tolower(*s1) == tolower(*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);
|
return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef strncasecmp
|
||||||
int strncasecmp(const char *s1, const char *s2, size_t n)
|
int strncasecmp(const char *s1, const char *s2, size_t n)
|
||||||
{
|
{
|
||||||
int d = 0;
|
int d = 0;
|
||||||
|
@ -26,3 +29,4 @@ int strncasecmp(const char *s1, const char *s2, size_t n)
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue