qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32


From: Avi Kivity
Subject: Re: [Qemu-devel] Re: [PATCH v2] sdl: fix setenv for win32
Date: Tue, 01 Jun 2010 09:33:09 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4

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<address@hidden>
---
  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 via email to

[Prev in Thread] Current Thread [Next in Thread]