| 1011 | } |
| 1012 | |
| 1013 | int |
| 1014 | SDL_strcasecmp(const char *str1, const char *str2) |
| 1015 | { |
| 1016 | #ifdef HAVE_STRCASECMP |
| 1017 | return strcasecmp(str1, str2); |
| 1018 | #elif defined(HAVE__STRICMP) |
| 1019 | return _stricmp(str1, str2); |
| 1020 | #else |
| 1021 | char a = 0; |
| 1022 | char b = 0; |
| 1023 | while (*str1 && *str2) { |
| 1024 | a = SDL_toupper((unsigned char) *str1); |
| 1025 | b = SDL_toupper((unsigned char) *str2); |
| 1026 | if (a != b) |
| 1027 | break; |
| 1028 | ++str1; |
| 1029 | ++str2; |
| 1030 | } |
| 1031 | a = SDL_toupper(*str1); |
| 1032 | b = SDL_toupper(*str2); |
| 1033 | return (int) ((unsigned char) a - (unsigned char) b); |
| 1034 | #endif /* HAVE_STRCASECMP */ |
| 1035 | } |
| 1036 | |
| 1037 | int |
| 1038 | SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen) |