Compilation of eglib/src/goutput.c was broken in commit
989165e1:
mono/eglib/src/goutput.c: In function 'monoeg_log_default_handler':
mono/eglib/src/goutput.c:159:75: error: 'args' undeclared (first use in this function)
__android_log_vprint (to_android_priority (log_level), log_domain, "%s", args);
^
mono/eglib/src/goutput.c:159:75: note: each undeclared identifier is reported only once for each function it appears in
mono/eglib/src/goutput.c: In function 'default_stdout_handler':
mono/eglib/src/goutput.c:168:2: error: incompatible type for argument 4 of '__android_log_vprint'
__android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
^
mono/eglib/src/goutput.c:139:0:
$ANDROID_NDK_PATH/platforms/android-4/arch-arm/usr/include/android/log.h:109:5: note: expected 'va_list' but argument is of type 'const gchar *'
int __android_log_vprint(int prio, const char *tag,
^
mono/eglib/src/goutput.c: In function 'default_stderr_handler':
mono/eglib/src/goutput.c:175:2: error: incompatible type for argument 4 of '__android_log_vprint'
__android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
^
(The cause of the breakage is that __android_log_vprint() takes a
va_args parameter, which is no longer present in
989165e1.)
Use __android_log_write() instead of __android_log_vprint().
Note: __android_log_write() writes a "simple string" to `adb logcat`,
meaning there is no printf(3)-style formatting applied.
void
g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
{
- __android_log_vprint (to_android_priority (log_level), log_domain, "%s", args);
+ __android_log_write (to_android_priority (log_level), log_domain, message);
if (log_level & fatal)
abort ();
}
default_stdout_handler (const gchar *message)
{
/* TODO: provide a proper app name */
- __android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
}
static void
default_stderr_handler (const gchar *message)
{
/* TODO: provide a proper app name */
- __android_log_vprint (ANDROID_LOG_ERROR, "mono", "%s", message);
+ __android_log_write (ANDROID_LOG_ERROR, "mono", message);
}