* [Qemu-devel] [PATCH] sdl: fix setenv for win32
@ 2010-05-25 2:23 TeLeMan
2010-05-25 6:20 ` [Qemu-devel] " Jan Kiszka
0 siblings, 1 reply; 2+ messages in thread
From: TeLeMan @ 2010-05-25 2:23 UTC (permalink / raw)
To: qemu-devel
setenv() is not implemented on MinGW, so we have to use putenv().
Signed-off-by: TeLeMan <geleman@gmail.com>
---
sdl.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sdl.c b/sdl.c
index add1148..eb4a87f 100644
--- a/sdl.c
+++ b/sdl.c
@@ -850,7 +850,11 @@ void sdl_display_init(DisplayState *ds, int
full_screen, int no_frame)
gui_noframe = 1;
if (!full_screen) {
+#ifdef _WIN32
+ 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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] sdl: fix setenv for win32
2010-05-25 2:23 [Qemu-devel] [PATCH] sdl: fix setenv for win32 TeLeMan
@ 2010-05-25 6:20 ` Jan Kiszka
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2010-05-25 6:20 UTC (permalink / raw)
To: TeLeMan; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1032 bytes --]
TeLeMan wrote:
> setenv() is not implemented on MinGW, so we have to use putenv().
What a ... pity.
>
> Signed-off-by: TeLeMan <geleman@gmail.com>
> ---
> sdl.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/sdl.c b/sdl.c
> index add1148..eb4a87f 100644
> --- a/sdl.c
> +++ b/sdl.c
> @@ -850,7 +850,11 @@ void sdl_display_init(DisplayState *ds, int
> full_screen, int no_frame)
> gui_noframe = 1;
>
> if (!full_screen) {
> +#ifdef _WIN32
> + putenv("SDL_VIDEO_ALLOW_SCREENSAVER=1");
This is not equivalent, the user will no longer be able to control the
value by setting it before starting qemu.
Let's check for the existence of SDL_VIDEO_ALLOW_SCREENSAVER first, set
it if it's not yet there, and do this for all platforms, leaving a
comment about the WIN32 dependency behind.
Jan
> +#else
> setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
> +#endif
> }
>
> flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-25 6:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25 2:23 [Qemu-devel] [PATCH] sdl: fix setenv for win32 TeLeMan
2010-05-25 6:20 ` [Qemu-devel] " Jan Kiszka
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).