src/stdlib/SDL_getenv.c
changeset 11653 4130b92b6be4
parent 11232 b26929d6ca20
child 11678 1f10a52295e3
equal deleted inserted replaced
11652:c3bf2954de06 11653:4130b92b6be4
    25 
    25 
    26 #include "../SDL_internal.h"
    26 #include "../SDL_internal.h"
    27 
    27 
    28 #if defined(__WIN32__)
    28 #if defined(__WIN32__)
    29 #include "../core/windows/SDL_windows.h"
    29 #include "../core/windows/SDL_windows.h"
       
    30 #endif
       
    31 
       
    32 #if defined(__ANDROID__)
       
    33 #include "../core/android/SDL_android.h"
    30 #endif
    34 #endif
    31 
    35 
    32 #include "SDL_stdinc.h"
    36 #include "SDL_stdinc.h"
    33 
    37 
    34 #if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
    38 #if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
   165     return (added ? 0 : -1);
   169     return (added ? 0 : -1);
   166 }
   170 }
   167 #endif
   171 #endif
   168 
   172 
   169 /* Retrieve a variable named "name" from the environment */
   173 /* Retrieve a variable named "name" from the environment */
   170 #if defined(HAVE_GETENV)
   174 #if defined(__ANDROID__)
       
   175 char *
       
   176 SDL_getenv(const char *name)
       
   177 {
       
   178     /* Input validation */
       
   179     if (!name || SDL_strlen(name)==0) {
       
   180         return NULL;
       
   181     }
       
   182 
       
   183     return SDL_AndroidGetManifestEnvironmentVariable(name);    
       
   184 }
       
   185 #elif defined(HAVE_GETENV)
   171 char *
   186 char *
   172 SDL_getenv(const char *name)
   187 SDL_getenv(const char *name)
   173 {
   188 {
   174     /* Input validation */
   189     /* Input validation */
   175     if (!name || SDL_strlen(name)==0) {
   190     if (!name || SDL_strlen(name)==0) {