Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
authorSam Lantinga <slouken@libsdl.org>
Mon, 02 Mar 2020 15:21:07 -0800
changeset 13581735c5920fc62
parent 13580 7d5111ab6f88
child 13582 85c4a2f0464d
Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
include/SDL_stdinc.h
src/dynapi/SDL_dynapi_overrides.h
src/dynapi/SDL_dynapi_procs.h
src/stdlib/SDL_stdlib.c
     1.1 --- a/include/SDL_stdinc.h	Mon Mar 02 15:14:52 2020 -0800
     1.2 +++ b/include/SDL_stdinc.h	Mon Mar 02 15:21:07 2020 -0800
     1.3 @@ -408,6 +408,8 @@
     1.4  
     1.5  extern DECLSPEC int SDLCALL SDL_isdigit(int x);
     1.6  extern DECLSPEC int SDLCALL SDL_isspace(int x);
     1.7 +extern DECLSPEC int SDLCALL SDL_isupper(int x);
     1.8 +extern DECLSPEC int SDLCALL SDL_islower(int x);
     1.9  extern DECLSPEC int SDLCALL SDL_toupper(int x);
    1.10  extern DECLSPEC int SDLCALL SDL_tolower(int x);
    1.11  
     2.1 --- a/src/dynapi/SDL_dynapi_overrides.h	Mon Mar 02 15:14:52 2020 -0800
     2.2 +++ b/src/dynapi/SDL_dynapi_overrides.h	Mon Mar 02 15:21:07 2020 -0800
     2.3 @@ -747,3 +747,5 @@
     2.4  #define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidBecomeActive_REAL
     2.5  #define SDL_OnApplicationDidChangeStatusBarOrientation SDL_OnApplicationDidChangeStatusBarOrientation_REAL
     2.6  #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL
     2.7 +#define SDL_isupper SDL_isupper_REAL
     2.8 +#define SDL_islower SDL_islower_REAL
     3.1 --- a/src/dynapi/SDL_dynapi_procs.h	Mon Mar 02 15:14:52 2020 -0800
     3.2 +++ b/src/dynapi/SDL_dynapi_procs.h	Mon Mar 02 15:21:07 2020 -0800
     3.3 @@ -807,3 +807,5 @@
     3.4  #ifdef __ANDROID__
     3.5  SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return)
     3.6  #endif
     3.7 +SDL_DYNAPI_PROC(int,SDL_isupper,(int a),(a),return)
     3.8 +SDL_DYNAPI_PROC(int,SDL_islower,(int a),(a),return)
     4.1 --- a/src/stdlib/SDL_stdlib.c	Mon Mar 02 15:14:52 2020 -0800
     4.2 +++ b/src/stdlib/SDL_stdlib.c	Mon Mar 02 15:21:07 2020 -0800
     4.3 @@ -438,11 +438,15 @@
     4.4  #if defined(HAVE_CTYPE_H)
     4.5  int SDL_isdigit(int x) { return isdigit(x); }
     4.6  int SDL_isspace(int x) { return isspace(x); }
     4.7 +int SDL_isupper(int x) { return isupper(x); }
     4.8 +int SDL_islower(int x) { return islower(x); }
     4.9  int SDL_toupper(int x) { return toupper(x); }
    4.10  int SDL_tolower(int x) { return tolower(x); }
    4.11  #else
    4.12  int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); }
    4.13  int SDL_isspace(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); }
    4.14 +int SDL_isupper(int x) { return ((x) >= 'A') && ((x) <= 'Z'); }
    4.15 +int SDL_islower(int x) { return ((x) >= 'a') && ((x) <= 'z'); }
    4.16  int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); }
    4.17  int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); }
    4.18  #endif