Files
rk35xx-android14/external/gwp_asan/android/test_printf.cpp
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

23 lines
596 B
C++

#include <async_safe/log.h>
#include <stdarg.h>
#include <unistd.h>
#include "gwp_asan/optional/printf.h"
namespace {
void PrintfWrapper(const char *Format, ...) {
va_list List;
va_start(List, Format);
async_safe_fatal_va_list("GWP-ASan", Format, List);
va_end(List);
}
} // anonymous namespace
namespace gwp_asan {
namespace test {
// Android version of the Printf() function for use in gwp_asan_unittest. You
// can find the declaration of this function in gwp_asan/optional/printf.h
Printf_t getPrintfFunction() { return PrintfWrapper; }
} // namespace test
} // namespace gwp_asan