src/stdlib/SDL_getenv.c
changeset 7351 668a3dc28361
parent 7003 eeaf77005c30
child 7828 1451063c8ecd
equal deleted inserted replaced
7350:302af2a46a66 7351:668a3dc28361
    29 static size_t SDL_envmemlen = 0;
    29 static size_t SDL_envmemlen = 0;
    30 #endif
    30 #endif
    31 
    31 
    32 
    32 
    33 /* Put a variable into the environment */
    33 /* Put a variable into the environment */
    34 #ifdef SDL_setenv
    34 #if defined(HAVE_SETENV)
    35 #undef SDL_setenv
    35 int
    36 int SDL_setenv(const char *name, const char *value, int overwrite) { return SDL_setenv_inline(name, value, overwrite); }
    36 SDL_setenv(const char *name, const char *value, int overwrite)
       
    37 {
       
    38     return setenv(name, value, overwrite);
       
    39 }
    37 #elif defined(__WIN32__)
    40 #elif defined(__WIN32__)
    38 int
    41 int
    39 SDL_setenv(const char *name, const char *value, int overwrite)
    42 SDL_setenv(const char *name, const char *value, int overwrite)
    40 {
    43 {
    41     if (!overwrite) {
    44     if (!overwrite) {
   141     return (added ? 0 : -1);
   144     return (added ? 0 : -1);
   142 }
   145 }
   143 #endif
   146 #endif
   144 
   147 
   145 /* Retrieve a variable named "name" from the environment */
   148 /* Retrieve a variable named "name" from the environment */
   146 #ifdef SDL_getenv
   149 #if defined(HAVE_GETENV)
   147 #undef SDL_getenv
   150 char *
   148 char *SDL_getenv(const char *name) { return SDL_getenv_inline(name); }
   151 SDL_getenv(const char *name)
       
   152 {
       
   153     return getenv(name);
       
   154 }
   149 #elif defined(__WIN32__)
   155 #elif defined(__WIN32__)
   150 char *
   156 char *
   151 SDL_getenv(const char *name)
   157 SDL_getenv(const char *name)
   152 {
   158 {
   153     size_t bufferlen;
   159     size_t bufferlen;