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

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

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.

>      }
> 
>      flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2010-06-01  6:28 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 ` Jan Kiszka [this message]
2010-06-01  6:33   ` [Qemu-devel] " Avi Kivity

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=4C04A87D.5060505@web.de \
    --to=jan.kiszka@web.de \
    --cc=geleman@gmail.com \
    --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).