From 9fa5da12e226e12b19e4971bf3d8d06ea2e4c2f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Fri, 27 Apr 2012 14:13:53 -0400 Subject: [PATCH] ffi/android: display Nit errors on the system log MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Redirect low level Nit error messages to the standard logging system on android. Signed-off-by: Alexis Laferrière --- clib/nit_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clib/nit_main.c b/clib/nit_main.c index 66533e8..0be5918 100644 --- a/clib/nit_main.c +++ b/clib/nit_main.c @@ -16,7 +16,12 @@ #include #include "gc.h" -#define PRINT_ERROR(...) ((void)fprintf(stderr, __VA_ARGS__)) +#ifdef ANDROID + #include + #define PRINT_ERROR(...) ((void)__android_log_print(ANDROID_LOG_WARN, "nit", __VA_ARGS__)) +#else + #define PRINT_ERROR(...) ((void)fprintf(stderr, __VA_ARGS__)) +#endif bigint object_id_counter = 1000000; enum gc_option { large, gc_opt_malloc, boehm, nitgc } gc_option; -- 1.7.9.5