qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: TeLeMan <geleman@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32
Date: Tue, 01 Jun 2010 09:33:09 +0300	[thread overview]
Message-ID: <4C04A9A5.7010101@redhat.com> (raw)
In-Reply-To: <4C04A87D.5060505@web.de>

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<geleman@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
>>      
> 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.

      reply	other threads:[~2010-06-01  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  1:44 [Qemu-devel] [PATCH v2] sdl: fix setenv for win32 TeLeMan
2010-06-01  6:28 ` [Qemu-devel] " Jan Kiszka
2010-06-01  6:33   ` Avi Kivity [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C04A9A5.7010101@redhat.com \
    --to=avi@redhat.com \
    --cc=geleman@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).