Move libc_log code into libasync_safe.
This library is used by a number of different libraries in the system.
Make it easy for platform libraries to use this library and create
an actual exported include file.
Change the names of the functions to reflect the new name of the library.
Run clang_format on the async_safe_log.cpp file since the formatting is
all over the place.
Bug: 31919199
Test: Compiled for angler/bullhead, and booted.
Test: Ran bionic unit tests.
Test: Ran the malloc debug tests.
Change-Id: I8071bf690c17b0ea3bc8dc5749cdd5b6ad58478a
diff --git a/libc/bionic/assert.cpp b/libc/bionic/assert.cpp
index 985fc38..41831cb 100644
--- a/libc/bionic/assert.cpp
+++ b/libc/bionic/assert.cpp
@@ -30,16 +30,16 @@
#include <assert.h>
-#include "private/libc_logging.h"
+#include <async_safe/log.h>
void __assert(const char* file, int line, const char* failed_expression) {
- __libc_fatal("%s:%d: assertion \"%s\" failed", file, line, failed_expression);
+ async_safe_fatal("%s:%d: assertion \"%s\" failed", file, line, failed_expression);
}
void __assert2(const char* file, int line, const char* function, const char* failed_expression) {
- __libc_fatal("%s:%d: %s: assertion \"%s\" failed", file, line, function, failed_expression);
+ async_safe_fatal("%s:%d: %s: assertion \"%s\" failed", file, line, function, failed_expression);
}
extern "C" __LIBC_HIDDEN__ void longjmperror() {
- __libc_fatal("longjmp botch");
+ async_safe_fatal("longjmp botch");
}