All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] sdl: fix setenv for win32
@ 2010-06-01  1:44 TeLeMan
  2010-06-01  6:28 ` [Qemu-devel] " Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: TeLeMan @ 2010-06-01  1:44 UTC (permalink / raw)
  To: qemu-devel, Jan Kiszka

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
     }

     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
-- 
1.6.5.1.1367.gcd48



--
SUN OF A BEACH

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32
  2010-06-01  1:44 [Qemu-devel] [PATCH v2] sdl: fix setenv for win32 TeLeMan
@ 2010-06-01  6:28 ` Jan Kiszka
  2010-06-01  6:33   ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2010-06-01  6:28 UTC (permalink / raw)
  To: TeLeMan; +Cc: qemu-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32
  2010-06-01  6:28 ` [Qemu-devel] " Jan Kiszka
@ 2010-06-01  6:33   ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2010-06-01  6:33 UTC (permalink / raw)
  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<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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-01  6:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.