未验证 提交 ab35e823 编写于 作者: O openharmony_ci 提交者: Gitee

!587 允许静态链接至musl的库调用musl log接口

Merge pull request !587 from Maplestory_zeng/master
......@@ -91,7 +91,8 @@ static int SendMessage(HilogMsg *header, const char *tag, uint16_t tagLen, const
return ret;
}
static int HiLogAdapterPrintArgs(
HILOG_LOCAL_API
int HiLogAdapterPrintArgs(
const LogType type, const LogLevel level, const unsigned int domain, const char *tag, const char *fmt, va_list ap)
{
char buf[MAX_LOG_LEN] = {0};
......@@ -112,6 +113,7 @@ static int HiLogAdapterPrintArgs(
return SendMessage(&header, tag, tagLen + 1, buf, logLen + 1);
}
HILOG_LOCAL_API
int HiLogAdapterPrint(LogType type, LogLevel level, unsigned int domain, const char *tag, const char *fmt, ...)
{
if (!HiLogAdapterIsLoggable(domain, tag, level)) {
......
......@@ -20,6 +20,8 @@
#include <stdio.h>
#include "malloc_impl.h"
/* Do not malloc in vsnprintf, thus the log api can be called inside signal handler*/
#define HILOG_PROHIBIT_ALLOCATION
/* Define the max length of the string */
#ifndef SECUREC_STRING_MAX_LEN
......@@ -137,8 +139,8 @@ typedef enum {
#endif
#else
#define SECUREC_MALLOC(x) (nullptr)
#define SECUREC_FREE(x) { printf("Malloc is not allowed, so free should not be possible to execute!"); std::abort(); }
#define SECUREC_MALLOC(x) (NULL)
#define SECUREC_FREE(x) {}
#endif
#if (defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)) || defined(__ARMCC_VERSION)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册