changeset 4979:be4ba07d9867

Added SDL errors to the Android log stream if DEBUG_ERROR is defined
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jan 2011 13:52:27 -0800
parents 4a7f284a82b2
children d9fdff945ec9
files src/SDL_error.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/SDL_error.c	Wed Jan 12 13:46:37 2011 -0800
+++ b/src/SDL_error.c	Wed Jan 12 13:52:27 2011 -0800
@@ -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"
 
@@ -111,7 +115,10 @@
     /* 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