[eglib] Fix compilation on PLATFORM_ANDROID.
authorJonathan Pryor <jonpryor@vt.edu>
Tue, 26 Aug 2014 02:43:48 +0000 (22:43 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Tue, 26 Aug 2014 02:58:30 +0000 (22:58 -0400)
commit9e7713121b36cf961c4ccd596c57734eaac6e911
tree30f6cff2789dbcb90b58b83bf2b095e215bf1910
parent28d400df31089f41cc74c75fecb266baec16e275
[eglib] Fix compilation on PLATFORM_ANDROID.

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.
eglib/src/goutput.c