From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37474 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJL2K-0000Qj-J9 for qemu-devel@nongnu.org; Tue, 01 Jun 2010 02:33:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJL2J-00032j-KE for qemu-devel@nongnu.org; Tue, 01 Jun 2010 02:33:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61754) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJL2J-00032c-AO for qemu-devel@nongnu.org; Tue, 01 Jun 2010 02:33:15 -0400 Message-ID: <4C04A9A5.7010101@redhat.com> Date: Tue, 01 Jun 2010 09:33:09 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32 References: <4C04A87D.5060505@web.de> In-Reply-To: <4C04A87D.5060505@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: TeLeMan , qemu-devel On 06/01/2010 09:28 AM, Jan Kiszka wrote: > TeLeMan wrote: > >> 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 >> > As I said: both variants are equivalent, no need for #ifdefs, just > consolidate over the open-coded version. > > The open coded version is less readable. qemu_setenv()? -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.