src/stdlib/SDL_getenv.c
changeset 11678 1f10a52295e3
parent 11653 4130b92b6be4
child 11811 5d94cb6b24d3
equal deleted inserted replaced
11677:aed6a9ff3c99 11678:1f10a52295e3
   169     return (added ? 0 : -1);
   169     return (added ? 0 : -1);
   170 }
   170 }
   171 #endif
   171 #endif
   172 
   172 
   173 /* Retrieve a variable named "name" from the environment */
   173 /* Retrieve a variable named "name" from the environment */
   174 #if defined(__ANDROID__)
   174 #if defined(HAVE_GETENV)
   175 char *
   175 char *
   176 SDL_getenv(const char *name)
   176 SDL_getenv(const char *name)
   177 {
   177 {
   178     /* Input validation */
   178 #if defined(__ANDROID__)
   179     if (!name || SDL_strlen(name)==0) {
   179     /* Make sure variables from the application manifest are available */
   180         return NULL;
   180     Android_JNI_GetManifestEnvironmentVariables();
   181     }
   181 #endif
   182 
   182 
   183     return SDL_AndroidGetManifestEnvironmentVariable(name);    
   183     /* Input validation */
   184 }
   184     if (!name || !*name) {
   185 #elif defined(HAVE_GETENV)
       
   186 char *
       
   187 SDL_getenv(const char *name)
       
   188 {
       
   189     /* Input validation */
       
   190     if (!name || SDL_strlen(name)==0) {
       
   191         return NULL;
   185         return NULL;
   192     }
   186     }
   193 
   187 
   194     return getenv(name);
   188     return getenv(name);
   195 }
   189 }