src/SDL_log.c
changeset 7614 af0bd07212bd
parent 7350 302af2a46a66
child 7710 6364d6836634
child 8477 ad08f0d710f3
     1.1 --- a/src/SDL_log.c	Thu Aug 08 21:16:29 2013 -0700
     1.2 +++ b/src/SDL_log.c	Thu Aug 08 21:29:30 2013 -0700
     1.3 @@ -317,6 +317,7 @@
     1.4  {
     1.5  #if defined(__WIN32__)
     1.6      /* Way too many allocations here, urgh */
     1.7 +    /* Note: One can't call SDL_SetError here, since that function itself logs. */
     1.8      {
     1.9          char *output;
    1.10          size_t length;
    1.11 @@ -331,16 +332,16 @@
    1.12              if (!attachResult) {
    1.13                      attachError = GetLastError();
    1.14                      if (attachError == ERROR_INVALID_HANDLE) {
    1.15 -                        SDL_SetError("Parent process has no console");
    1.16 +                        OutputDebugString(TEXT("Parent process has no console"));
    1.17                          consoleAttached = -1;
    1.18                      } else if (attachError == ERROR_GEN_FAILURE) {
    1.19 -                         SDL_SetError("Could not attach to console of parent process");
    1.20 +                         OutputDebugString(TEXT("Could not attach to console of parent process"));
    1.21                           consoleAttached = -1;
    1.22                      } else if (attachError == ERROR_ACCESS_DENIED) {  
    1.23                           /* Already attached */
    1.24                          consoleAttached = 1;
    1.25                      } else {
    1.26 -                        SDL_SetError("Error %d attaching console", attachError);
    1.27 +                        OutputDebugString(TEXT("Error attaching console"));
    1.28                          consoleAttached = -1;
    1.29                      }
    1.30                  } else {
    1.31 @@ -364,10 +365,10 @@
    1.32          /* Screen output to stderr, if console was attached. */
    1.33          if (consoleAttached == 1) {
    1.34                  if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) {
    1.35 -                    SDL_SetError("Error %d calling WriteConsole", GetLastError());
    1.36 +                    OutputDebugString(TEXT("Error calling WriteConsole"));
    1.37                  }
    1.38                  if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) {
    1.39 -                    SDL_SetError("Insufficient heap memory to write message of size %d", length);
    1.40 +                    OutputDebugString(TEXT("Insufficient heap memory to write message"));
    1.41                  }
    1.42          }
    1.43