src/SDL_log.c
changeset 8583 fb2933ca805f
parent 8149 681eb46b8ac4
parent 8582 c3e9a2b93517
child 8820 0e935d5b193a
     1.1 --- a/src/SDL_log.c	Sun Mar 09 10:38:30 2014 -0700
     1.2 +++ b/src/SDL_log.c	Sun Mar 09 11:36:47 2014 -0700
     1.3 @@ -20,7 +20,7 @@
     1.4  */
     1.5  #include "./SDL_internal.h"
     1.6  
     1.7 -#if defined(__WIN32__)
     1.8 +#if defined(__WIN32__) || defined(__WINRT__)
     1.9  #include "core/windows/SDL_windows.h"
    1.10  #endif
    1.11  
    1.12 @@ -318,13 +318,15 @@
    1.13  SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
    1.14                const char *message)
    1.15  {
    1.16 -#if defined(__WIN32__)
    1.17 +#if defined(__WIN32__) || defined(__WINRT__)
    1.18      /* Way too many allocations here, urgh */
    1.19      /* Note: One can't call SDL_SetError here, since that function itself logs. */
    1.20      {
    1.21          char *output;
    1.22          size_t length;
    1.23          LPTSTR tstr;
    1.24 +
    1.25 +#ifndef __WINRT__
    1.26          BOOL attachResult;
    1.27          DWORD attachError;
    1.28          unsigned long charsWritten; 
    1.29 @@ -356,6 +358,7 @@
    1.30                          stderrHandle = GetStdHandle(STD_ERROR_HANDLE);
    1.31                  }
    1.32          }
    1.33 +#endif /* ifndef __WINRT__ */
    1.34  
    1.35          length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1 + 1;
    1.36          output = SDL_stack_alloc(char, length);
    1.37 @@ -365,6 +368,7 @@
    1.38          /* Output to debugger */
    1.39          OutputDebugString(tstr);
    1.40         
    1.41 +#ifndef __WINRT__
    1.42          /* Screen output to stderr, if console was attached. */
    1.43          if (consoleAttached == 1) {
    1.44                  if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) {
    1.45 @@ -374,6 +378,7 @@
    1.46                      OutputDebugString(TEXT("Insufficient heap memory to write message\r\n"));
    1.47                  }
    1.48          }
    1.49 +#endif /* ifndef __WINRT__ */
    1.50  
    1.51          SDL_free(tstr);
    1.52          SDL_stack_free(output);