Patch configure so that we dont need a seperate spec file for x86_64. Pass info about...
[AROS.git] / arch / all-android / bootstrap / kputc.c
blob732da2170d87c1ff2d262a41404a33bb03d06f0e
1 #include <android/log.h>
2 #include <stdarg.h>
3 #include <stdio.h>
5 #include "bootstrap.h"
6 #include "hostlib.h"
8 static int p = 0;
11 * On Android additionally to stderr we output the log to Android's
12 * own buffer. This is better than nothing.
13 * Since Android's debug output is line-oriented, we have to accumulate
14 * the text in the buffer.
17 static void flushLog(void)
19 buf[p] = 0;
20 __android_log_write(ANDROID_LOG_DEBUG, "AROS", buf);
21 p = 0;
24 int KPutC(int chr)
26 int ret;
28 ret = fputc(chr, stderr);
30 if (chr == '\n')
32 fflush(stderr);
33 flushLog();
35 else
37 buf[p++] = chr;
39 if (p == BUFFER_SIZE - 1)
40 flushLog();
43 return ret;