Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Added SDL errors to the Android log stream if DEBUG_ERROR is defined
  • Loading branch information
slouken committed Jan 12, 2011
1 parent 76a58bf commit 6deb4b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SDL_error.c
Expand Up @@ -23,6 +23,10 @@

/* Simple error handling in SDL */

#ifdef __ANDROID__
#include <android/log.h>
#endif

#include "SDL_error.h"
#include "SDL_error_c.h"

Expand Down Expand Up @@ -111,7 +115,10 @@ SDL_SetError(const char *fmt, ...)
/* If we are in debug mode, print out an error message */
#ifdef DEBUG_ERROR
fprintf(stderr, "SDL_SetError: %s\n", SDL_GetError());
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "SDL", "ERROR: %s", SDL_GetError());
#endif
#endif /* DEBUG_ERROR */
}

/* This function has a bit more overhead than most error functions
Expand Down

0 comments on commit 6deb4b2

Please sign in to comment.