comparison include/SDL_stdinc.h @ 3581:15eea7a1fa97

Implemented SDL_setenv(), moved SDL_putenv() to compat. Fixes Bugzilla #779.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 16 Dec 2009 10:59:51 +0000
parents fb9ea4b549c3
children f7b03b6838cb
comparison
equal deleted inserted replaced
3580:951dd6a5d1a2 3581:15eea7a1fa97
265 #define SDL_getenv getenv 265 #define SDL_getenv getenv
266 #else 266 #else
267 extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); 267 extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
268 #endif 268 #endif
269 269
270 /** 270 /* SDL_putenv() has moved to SDL_compat. */
271 * \warning On some platforms, the string you pass to SDL_putenv() becomes 271 #ifdef HAVE_SETENV
272 * part of the environment table directly...it will use this specific 272 #define SDL_setenv setenv
273 * buffer, and not a copy of it! This means you can't free it, and 273 #else
274 * other pieces of code may try to write to it. In practice, this 274 extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value,
275 * isn't a big deal, but be aware of the possibility. 275 int overwrite);
276 * However, due to this issue, you should be prepared to
277 * pass a (char*), or be willing to cast away the constness of your
278 * string for this call.
279 */
280 #ifdef HAVE_PUTENV
281 #define SDL_putenv putenv
282 #else
283 extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
284 #endif 276 #endif
285 277
286 #ifdef HAVE_QSORT 278 #ifdef HAVE_QSORT
287 #define SDL_qsort qsort 279 #define SDL_qsort qsort
288 #else 280 #else