comparison src/audio/windib/SDL_dibaudio.c @ 5131:2c500f37abcf

merged: might need to check main.c in the iOS template to make sure no changes were abandoned.
author Eric Wing <ewing . public |-at-| gmail . com>
date Tue, 01 Feb 2011 00:37:02 -0800
parents 327f181542f1
children b530ef003506
comparison
equal deleted inserted replaced
5078:067973aec4d8 5131:2c500f37abcf
21 */ 21 */
22 #include "SDL_config.h" 22 #include "SDL_config.h"
23 23
24 /* Allow access to a raw mixing buffer */ 24 /* Allow access to a raw mixing buffer */
25 25
26 #define WIN32_LEAN_AND_MEAN 26 #include "../../core/windows/SDL_windows.h"
27 #include <windows.h>
28 #include <mmsystem.h> 27 #include <mmsystem.h>
29 28
30 #include "SDL_timer.h" 29 #include "SDL_timer.h"
31 #include "SDL_audio.h" 30 #include "SDL_audio.h"
32 #include "../SDL_audio_c.h" 31 #include "../SDL_audio_c.h"
65 static void 64 static void
66 SetMMerror(char *function, MMRESULT code) 65 SetMMerror(char *function, MMRESULT code)
67 { 66 {
68 size_t len; 67 size_t len;
69 char errbuf[MAXERRORLENGTH]; 68 char errbuf[MAXERRORLENGTH];
70 #ifdef _WIN32_WCE
71 wchar_t werrbuf[MAXERRORLENGTH]; 69 wchar_t werrbuf[MAXERRORLENGTH];
72 #endif
73 70
74 SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); 71 SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
75 len = SDL_strlen(errbuf); 72 len = SDL_strlen(errbuf);
76 73
77 #ifdef _WIN32_WCE
78 /* UNICODE version */
79 waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len); 74 waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len);
80 WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len, 75 WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len,
81 MAXERRORLENGTH - len, NULL, NULL); 76 MAXERRORLENGTH - len, NULL, NULL);
82 #else
83 waveOutGetErrorText(code, errbuf + len, (UINT) (MAXERRORLENGTH - len));
84 #endif
85 77
86 SDL_SetError("%s", errbuf); 78 SDL_SetError("%s", errbuf);
87 } 79 }
88 80
89 /* Set high priority for the audio thread */ 81 /* Set high priority for the audio thread */