summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-04 21:07:06 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-04 21:07:06 +0000
commit09f6556e223cc9ac851304117bf1dfaf9b5582f3 (patch)
treeee0e5a194d74c350ad653ec938718e6212fade87
parent280d9074abc7dd6d572da06700d6684e64e1961e (diff)
downloadrockbox-09f6556e223cc9ac851304117bf1dfaf9b5582f3.tar.gz
rockbox-09f6556e223cc9ac851304117bf1dfaf9b5582f3.zip
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
-rw-r--r--firmware/common/strcasecmp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/common/strcasecmp.c b/firmware/common/strcasecmp.c
index b9dd6c13c4..cdfbe2f81a 100644
--- a/firmware/common/strcasecmp.c
+++ b/firmware/common/strcasecmp.c
@@ -2,6 +2,7 @@
2#include <string.h> 2#include <string.h>
3#include <ctype.h> 3#include <ctype.h>
4 4
5#ifndef strcasecmp
5int strcasecmp(const char *s1, const char *s2) 6int strcasecmp(const char *s1, const char *s2)
6{ 7{
7 while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) { 8 while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) {
@@ -11,7 +12,9 @@ int strcasecmp(const char *s1, const char *s2)
11 12
12 return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); 13 return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2);
13} 14}
15#endif
14 16
17#ifndef strncasecmp
15int strncasecmp(const char *s1, const char *s2, size_t n) 18int strncasecmp(const char *s1, const char *s2, size_t n)
16{ 19{
17 int d = 0; 20 int d = 0;
@@ -26,3 +29,4 @@ int strncasecmp(const char *s1, const char *s2, size_t n)
26 29
27 return d; 30 return d;
28} 31}
32#endif