提交 9fa1ce1a 编写于 作者: L laiguizhong

隐藏不开放API符号

Signed-off-by: Nlaiguizhong <laiguizhong@huawei.com>
上级 7850741d
...@@ -25,6 +25,15 @@ extern "C" { ...@@ -25,6 +25,15 @@ extern "C" {
#ifndef INIT_LOG_PATH #ifndef INIT_LOG_PATH
#define INIT_LOG_PATH "/data/init_agent/" #define INIT_LOG_PATH "/data/init_agent/"
#endif #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 { typedef enum InitLogLevel {
INIT_DEBUG = 0, INIT_DEBUG = 0,
INIT_INFO, INIT_INFO,
......
...@@ -161,7 +161,7 @@ static int AcceptTcpSocket_(int serverFd) ...@@ -161,7 +161,7 @@ static int AcceptTcpSocket_(int serverFd)
LE_LOGV("AcceptTcpSocket_ client: %s ", inet_ntoa(clientAddr.sin_addr)); LE_LOGV("AcceptTcpSocket_ client: %s ", inet_ntoa(clientAddr.sin_addr));
return fd; return fd;
} }
INIT_LOCAL_API
int CreateSocket(int flags, const char *server) int CreateSocket(int flags, const char *server)
{ {
int fd = -1; int fd = -1;
...@@ -186,7 +186,7 @@ int CreateSocket(int flags, const char *server) ...@@ -186,7 +186,7 @@ int CreateSocket(int flags, const char *server)
} }
return fd; return fd;
} }
INIT_LOCAL_API
int AcceptSocket(int fd, int flags) int AcceptSocket(int fd, int flags)
{ {
int clientFd = -1; int clientFd = -1;
......
...@@ -17,13 +17,16 @@ ...@@ -17,13 +17,16 @@
#define LE_SOCKET_H #define LE_SOCKET_H
#include "le_utils.h" #include "le_utils.h"
#include "loop_event.h" #include "loop_event.h"
#include "beget_ext.h"
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
extern "C" { extern "C" {
#endif #endif
#endif #endif
INIT_LOCAL_API
int CreateSocket(int flags, const char *server); int CreateSocket(int flags, const char *server);
INIT_LOCAL_API
int AcceptSocket(int fd, int flags); int AcceptSocket(int fd, int flags);
#ifdef __cplusplus #ifdef __cplusplus
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册