setenv() is not implemented on MinGW, so we have to use putenv().

Signed-off-by: TeLeMan <gele...@gmail.com>
---
 sdl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/sdl.c b/sdl.c
index add1148..eac898a 100644
--- a/sdl.c
+++ b/sdl.c
@@ -850,7 +850,14 @@ void sdl_display_init(DisplayState *ds, int
full_screen, int no_frame)
         gui_noframe = 1;

     if (!full_screen) {
+#ifdef _WIN32
+        /* setenv() is not implemented on MinGW */
+        if(!getenv("SDL_VIDEO_ALLOW_SCREENSAVER")) {
+            putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1");
+        }
+#else
         setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+#endif
     }

     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
-- 
1.6.5.1.1367.gcd48



--
SUN OF A BEACH

Reply via email to