summaryrefslogtreecommitdiff
path: root/src/stdlib
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2020-03-02 15:21:07 -0800
committerSam Lantinga <slouken@libsdl.org>2020-03-02 15:21:07 -0800
commit6b567be4e7b60c83d81b329666a09e1114495d15 (patch)
tree37357723df83e949ee2cebc76c2ceafe7442b258 /src/stdlib
parent36d9a08eb719c392c07712913acab31dfde6c388 (diff)
downloadsdl-6b567be4e7b60c83d81b329666a09e1114495d15.tar.gz
Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
Diffstat (limited to 'src/stdlib')
-rw-r--r--src/stdlib/SDL_stdlib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c
index bef47c751..c2774cb2c 100644
--- a/src/stdlib/SDL_stdlib.c
+++ b/src/stdlib/SDL_stdlib.c
@@ -438,11 +438,15 @@ int SDL_abs(int x)
#if defined(HAVE_CTYPE_H)
int SDL_isdigit(int x) { return isdigit(x); }
int SDL_isspace(int x) { return isspace(x); }
+int SDL_isupper(int x) { return isupper(x); }
+int SDL_islower(int x) { return islower(x); }
int SDL_toupper(int x) { return toupper(x); }
int SDL_tolower(int x) { return tolower(x); }
#else
int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); }
int SDL_isspace(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); }
+int SDL_isupper(int x) { return ((x) >= 'A') && ((x) <= 'Z'); }
+int SDL_islower(int x) { return ((x) >= 'a') && ((x) <= 'z'); }
int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); }
int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); }
#endif