From 6deb4b2c34e986d28c968348d446cecc8164257d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 12 Jan 2011 13:52:27 -0800 Subject: [PATCH] Added SDL errors to the Android log stream if DEBUG_ERROR is defined --- src/SDL_error.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SDL_error.c b/src/SDL_error.c index 1f6c8a903..f2d0e029d 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -23,6 +23,10 @@ /* Simple error handling in SDL */ +#ifdef __ANDROID__ +#include +#endif + #include "SDL_error.h" #include "SDL_error_c.h" @@ -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