From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56289 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJGWR-0003V8-SJ for qemu-devel@nongnu.org; Mon, 31 May 2010 21:44:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJGWQ-0003sf-Pq for qemu-devel@nongnu.org; Mon, 31 May 2010 21:44:03 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:45672) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJGWQ-0003sN-LU for qemu-devel@nongnu.org; Mon, 31 May 2010 21:44:02 -0400 Received: by pwi7 with SMTP id 7so1019082pwi.4 for ; Mon, 31 May 2010 18:44:01 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 1 Jun 2010 09:44:01 +0800 Message-ID: From: TeLeMan Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH v2] sdl: fix setenv for win32 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Jan Kiszka setenv() is not implemented on MinGW, so we have to use putenv(). Signed-off-by: TeLeMan --- 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