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

!576 隐藏不开放的函数符号,解决符号冲突

Merge pull request !576 from Mupceet/master_cc
......@@ -25,6 +25,15 @@ extern "C" {
#ifndef INIT_LOG_PATH
#define INIT_LOG_PATH "/data/init_agent/"
#endif
#if defined(__GNUC__) && (__GNUC__ >= 4)
#define INIT_PUBLIC_API __attribute__((visibility ("default")))
#define INIT_LOCAL_API __attribute__((visibility("hidden")))
#else
#define INIT_PUBLIC_API
#define INIT_LOCAL_API
#endif
typedef enum InitLogLevel {
INIT_DEBUG = 0,
INIT_INFO,
......
......@@ -161,7 +161,7 @@ static int AcceptTcpSocket_(int serverFd)
LE_LOGV("AcceptTcpSocket_ client: %s ", inet_ntoa(clientAddr.sin_addr));
return fd;
}
INIT_LOCAL_API
int CreateSocket(int flags, const char *server)
{
int fd = -1;
......@@ -186,7 +186,7 @@ int CreateSocket(int flags, const char *server)
}
return fd;
}
INIT_LOCAL_API
int AcceptSocket(int fd, int flags)
{
int clientFd = -1;
......
......@@ -17,13 +17,16 @@
#define LE_SOCKET_H
#include "le_utils.h"
#include "loop_event.h"
#include "beget_ext.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
INIT_LOCAL_API
int CreateSocket(int flags, const char *server);
INIT_LOCAL_API
int AcceptSocket(int fd, int flags);
#ifdef __cplusplus
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册