diff options
author | Sam Lantinga <slouken@libsdl.org> | 2020-03-02 15:21:07 -0800 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2020-03-02 15:21:07 -0800 |
commit | 6b567be4e7b60c83d81b329666a09e1114495d15 (patch) | |
tree | 37357723df83e949ee2cebc76c2ceafe7442b258 /src/stdlib | |
parent | 36d9a08eb719c392c07712913acab31dfde6c388 (diff) | |
download | sdl-6b567be4e7b60c83d81b329666a09e1114495d15.tar.gz |
Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
Diffstat (limited to 'src/stdlib')
-rw-r--r-- | src/stdlib/SDL_stdlib.c | 4 |
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 |