diff src/audio/windib/SDL_dibaudio.c @ 5092:327f181542f1

Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share. I think this also fixes the bug relating to non-latin characters in filenames, since UNICODE wasn't defined in SDL_rwops.c
author Sam Lantinga <slouken@libsdl.org>
date Mon, 24 Jan 2011 21:20:30 -0800
parents 4160ba33b597
children b530ef003506
line wrap: on
line diff
--- a/src/audio/windib/SDL_dibaudio.c	Mon Jan 24 17:47:18 2011 -0800
+++ b/src/audio/windib/SDL_dibaudio.c	Mon Jan 24 21:20:30 2011 -0800
@@ -23,8 +23,7 @@
 
 /* Allow access to a raw mixing buffer */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 #include <mmsystem.h>
 
 #include "SDL_timer.h"
@@ -67,21 +66,14 @@
 {
     size_t len;
     char errbuf[MAXERRORLENGTH];
-#ifdef _WIN32_WCE
     wchar_t werrbuf[MAXERRORLENGTH];
-#endif
 
     SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
     len = SDL_strlen(errbuf);
 
-#ifdef _WIN32_WCE
-    /* UNICODE version */
     waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len);
     WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len,
                         MAXERRORLENGTH - len, NULL, NULL);
-#else
-    waveOutGetErrorText(code, errbuf + len, (UINT) (MAXERRORLENGTH - len));
-#endif
 
     SDL_SetError("%s", errbuf);
 }