From: Alexis Laferrière Date: Fri, 27 Apr 2012 18:13:53 +0000 (-0400) Subject: ffi/android: display Nit errors on the system log X-Git-Tag: v0.6~100^2~12 X-Git-Url: http://nitlanguage.org?hp=aebca6e86887842b08663a61f97c1e8924d80b5b ffi/android: display Nit errors on the system log Redirect low level Nit error messages to the standard logging system on android. Signed-off-by: Alexis Laferrière --- 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;