mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 12:14:41 +02:00
Upgrade to SDL2.0.3.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "./SDL_internal.h"
|
||||
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WIN32__) || defined(__WINRT__)
|
||||
#include "core/windows/SDL_windows.h"
|
||||
#endif
|
||||
|
||||
@@ -318,13 +318,15 @@ static void
|
||||
SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
|
||||
const char *message)
|
||||
{
|
||||
#if defined(__WIN32__)
|
||||
#if defined(__WIN32__) || defined(__WINRT__)
|
||||
/* Way too many allocations here, urgh */
|
||||
/* Note: One can't call SDL_SetError here, since that function itself logs. */
|
||||
{
|
||||
char *output;
|
||||
size_t length;
|
||||
LPTSTR tstr;
|
||||
|
||||
#ifndef __WINRT__
|
||||
BOOL attachResult;
|
||||
DWORD attachError;
|
||||
unsigned long charsWritten;
|
||||
@@ -356,6 +358,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 + 1;
|
||||
output = SDL_stack_alloc(char, length);
|
||||
@@ -365,6 +368,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)) {
|
||||
@@ -374,6 +378,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
|
||||
OutputDebugString(TEXT("Insufficient heap memory to write message\r\n"));
|
||||
}
|
||||
}
|
||||
#endif /* ifndef __WINRT__ */
|
||||
|
||||
SDL_free(tstr);
|
||||
SDL_stack_free(output);
|
||||
|
||||
Reference in New Issue
Block a user