src/stdlib/SDL_getenv.c
changeset 11653 4130b92b6be4
parent 11232 b26929d6ca20
child 11678 1f10a52295e3
     1.1 --- a/src/stdlib/SDL_getenv.c	Tue Oct 24 00:04:40 2017 -0700
     1.2 +++ b/src/stdlib/SDL_getenv.c	Tue Oct 24 00:17:07 2017 -0700
     1.3 @@ -29,6 +29,10 @@
     1.4  #include "../core/windows/SDL_windows.h"
     1.5  #endif
     1.6  
     1.7 +#if defined(__ANDROID__)
     1.8 +#include "../core/android/SDL_android.h"
     1.9 +#endif
    1.10 +
    1.11  #include "SDL_stdinc.h"
    1.12  
    1.13  #if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
    1.14 @@ -167,7 +171,18 @@
    1.15  #endif
    1.16  
    1.17  /* Retrieve a variable named "name" from the environment */
    1.18 -#if defined(HAVE_GETENV)
    1.19 +#if defined(__ANDROID__)
    1.20 +char *
    1.21 +SDL_getenv(const char *name)
    1.22 +{
    1.23 +    /* Input validation */
    1.24 +    if (!name || SDL_strlen(name)==0) {
    1.25 +        return NULL;
    1.26 +    }
    1.27 +
    1.28 +    return SDL_AndroidGetManifestEnvironmentVariable(name);    
    1.29 +}
    1.30 +#elif defined(HAVE_GETENV)
    1.31  char *
    1.32  SDL_getenv(const char *name)
    1.33  {