WinRT: build fixes and additional WinRT-related integrations with SDL 2.0.0

This commit is contained in:
David Ludwig 2013-08-13 20:09:52 -04:00
parent 88461d442a
commit ef0a40b704
13 changed files with 110 additions and 31 deletions

View file

@ -322,6 +322,8 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
char *output;
size_t length;
LPTSTR tstr;
#ifndef __WINRT__
BOOL attachResult;
DWORD attachError;
unsigned long charsWritten;
@ -353,6 +355,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
stderrHandle = GetStdHandle(STD_ERROR_HANDLE);
}
}
#endif /* ifndef __WINRT__ */
length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1;
output = SDL_stack_alloc(char, length);
@ -362,6 +365,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
/* Output to debugger */
OutputDebugString(tstr);
#ifndef __WINRT__
/* Screen output to stderr, if console was attached. */
if (consoleAttached == 1) {
if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) {
@ -371,6 +375,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
OutputDebugString(TEXT("Insufficient heap memory to write message"));
}
}
#endif /* ifndef __WINRT__ */
SDL_free(tstr);
SDL_stack_free(output);