mirror of
https://github.com/corda/corda.git
synced 2025-01-06 05:04:20 +00:00
Replaced printf with __mingw_printf to avoid strange crushes
This commit is contained in:
parent
abc9316702
commit
763c95d98e
@ -895,6 +895,21 @@ jniStrError(int error, char* buffer, size_t length)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Android log priority values (as text)
|
||||||
|
*/
|
||||||
|
const char * const androidLogPriorityTitles[] = {
|
||||||
|
"UNKNOWN",
|
||||||
|
"DEFAULT",
|
||||||
|
"VERBOSE",
|
||||||
|
"DEBUG",
|
||||||
|
"INFO",
|
||||||
|
"WARNING",
|
||||||
|
"ERROR",
|
||||||
|
"FATAL",
|
||||||
|
"SILENT"
|
||||||
|
};
|
||||||
|
|
||||||
extern "C" int
|
extern "C" int
|
||||||
__android_log_print(int priority, const char* tag, const char* format, ...)
|
__android_log_print(int priority, const char* tag, const char* format, ...)
|
||||||
{
|
{
|
||||||
@ -906,7 +921,11 @@ __android_log_print(int priority, const char* tag, const char* format, ...)
|
|||||||
::vsnprintf(buffer, size, format, a);
|
::vsnprintf(buffer, size, format, a);
|
||||||
va_end(a);
|
va_end(a);
|
||||||
|
|
||||||
return fprintf(stderr, "%d %s %s\n", priority, tag, buffer);
|
#ifndef PLATFORM_WINDOWS
|
||||||
|
return printf("[%s] %s: %s\n", androidLogPriorityTitles[priority], tag, buffer);
|
||||||
|
#else
|
||||||
|
return __mingw_fprintf(stderr, "[%s] %s: %s\n", androidLogPriorityTitles[priority], tag, buffer);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" int
|
extern "C" int
|
||||||
|
Loading…
Reference in New Issue
Block a user