Hide symbol of common lib 06/73206/4
authorKyungwook Tak <k.tak@samsung.com>
Tue, 7 Jun 2016 05:51:51 +0000 (14:51 +0900)
committerkyungwook tak <k.tak@samsung.com>
Tue, 7 Jun 2016 08:00:24 +0000 (01:00 -0700)
Change-Id: I8fd63c172b13380ccf8e810fee7c25ebafef0813
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
24 files changed:
src/framework/CMakeLists.txt
src/framework/client/content-screening.cpp
src/framework/client/engine-manager.cpp
src/framework/client/utils.h
src/framework/client/web-protection.cpp
src/framework/common/audit/logger.h
src/framework/common/binary-queue.h
src/framework/common/connection.h
src/framework/common/credential.h
src/framework/common/cs-context.h
src/framework/common/cs-detected.h
src/framework/common/dispatcher.h
src/framework/common/em-context.h
src/framework/common/exception.h
src/framework/common/kvp-container.h
src/framework/common/macros.h [new file with mode: 0644]
src/framework/common/mainloop.h
src/framework/common/serialization.h
src/framework/common/service.h
src/framework/common/socket-descriptor.h
src/framework/common/socket.h
src/framework/common/wp-context.h
src/framework/common/wp-result.h
src/framework/service/access-control.h

index 9765648..1db36f9 100644 (file)
@@ -67,7 +67,7 @@ ADD_LIBRARY(${TARGET_CSR_COMMON} SHARED ${${TARGET_CSR_COMMON}_SRCS})
 
 SET_TARGET_PROPERTIES(${TARGET_CSR_COMMON}
        PROPERTIES
-               COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=default" # TODO: visibility hidden
+               COMPILE_FLAGS "-D_GNU_SOURCE -fvisibility=hidden"
                SOVERSION ${API_VERSION}
                VERSION ${VERSION}
 )
index ac3365c..181bbfa 100644 (file)
@@ -28,6 +28,7 @@
 #include "client/handle-ext.h"
 #include "client/async-logic.h"
 #include "client/canonicalize.h"
+#include "common/macros.h"
 #include "common/types.h"
 #include "common/cs-context.h"
 #include "common/cs-detected.h"
index dd8d564..3d39bde 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "client/utils.h"
 #include "client/handle.h"
+#include "common/macros.h"
 #include "common/command-id.h"
 #include "common/em-context.h"
 #include "common/audit/logger.h"
index 0cc0d0a..599ebeb 100644 (file)
@@ -25,8 +25,6 @@
 
 #include "client/callback.h"
 
-#define API __attribute__((visibility("default")))
-
 #define EXCEPTION_SAFE_START return Csr::Client::exceptionGuard([&]()->int {
 #define EXCEPTION_SAFE_END });
 
index a05695e..b76f5b2 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "client/utils.h"
 #include "client/handle.h"
+#include "common/macros.h"
 #include "common/types.h"
 #include "common/command-id.h"
 #include "common/wp-context.h"
index a76ffbf..de4a71c 100644 (file)
@@ -29,6 +29,8 @@
 
 #include <cstring>
 
+#include "common/macros.h"
+
 namespace Csr {
 namespace Audit {
 
@@ -40,7 +42,7 @@ enum class LogLevel : int {
        Trace
 };
 
-class Logger {
+class API Logger {
 public:
        static void log(LogLevel level,
                                        const std::string &file,
index 7519b91..3d28707 100644 (file)
 #include <memory>
 #include <cstddef>
 
+#include "common/macros.h"
 #include "common/serialization.h"
 #include "common/types.h"
 
 namespace Csr {
 
-class BinaryQueue : public IStream {
+class API BinaryQueue : public IStream {
 public:
        BinaryQueue() noexcept;
        virtual ~BinaryQueue() = default;
index 9667d84..842a511 100644 (file)
 #include <memory>
 #include <mutex>
 
+#include "common/macros.h"
 #include "common/socket.h"
 #include "common/types.h"
 #include "common/credential.h"
 
 namespace Csr {
 
-class Connection {
+class API Connection {
 public:
        explicit Connection(Socket &&socket) noexcept;
        virtual ~Connection() = default;
index 941941f..4f8f1e8 100644 (file)
 #include <string>
 #include <sys/types.h>
 
+#include "common/macros.h"
+
 namespace Csr {
 
-struct Credential {
+struct API Credential {
        uid_t uid;
        gid_t gid;
        std::string label;
index f756cdd..0161c26 100644 (file)
 #include <string>
 #include <memory>
 
-#include "common/icontext.h"
 #include <csr-content-screening-types.h>
 
+#include "common/macros.h"
+#include "common/icontext.h"
+
 namespace Csr {
 
 struct CsContext;
 using CsContextPtr = std::unique_ptr<CsContext>;
 using CsContextShPtr = std::shared_ptr<CsContext>;
 
-struct CsContext : public IContext {
+struct API CsContext : public IContext {
        enum class Key : int {
                PopupMessage = 0x01, // string
 
index f355dfe..587a3b9 100644 (file)
 #include <string>
 #include <ctime>
 
-#include "common/iresult.h"
 #include <csr-content-screening-types.h>
 
+#include "common/macros.h"
+#include "common/iresult.h"
+
 namespace Csr {
 
 class CsDetected;
 using CsDetectedPtr = std::unique_ptr<CsDetected>;
 
-struct CsDetected : public IResult {
+struct API CsDetected : public IResult {
        CsDetected() noexcept;
        virtual ~CsDetected() = default;
 
index 07199ab..716e4e0 100644 (file)
 
 #include <string>
 
+#include "common/macros.h"
 #include "common/connection.h"
 #include "common/binary-queue.h"
 
 namespace Csr {
 
-class Dispatcher {
+class API Dispatcher {
 public:
        Dispatcher(SockId) noexcept;
        virtual ~Dispatcher() = default;
index cb47a50..825b4ec 100644 (file)
  */
 #pragma once
 
-#include "common/icontext.h"
 #include <csr-engine-manager.h>
 
+#include "common/macros.h"
+#include "common/icontext.h"
+
 namespace Csr {
 
 struct EmContext;
 using EmContextShPtr = std::shared_ptr<EmContext>;
 
-struct EmContext : public IContext {
+struct API EmContext : public IContext {
        enum class Key : int {
                EngineId = 0x01 // int
        };
index 9f450bc..6879c28 100644 (file)
 #include <csr-error.h>
 
 #include "common/audit/logger.h"
+#include "common/macros.h"
 
 namespace Csr {
 
-class Exception : public std::exception {
+class API Exception : public std::exception {
 public:
        Exception(int ec, const char *file, const char *function, unsigned int line,
                          const std::string &message) noexcept;
index f9d1e90..6aefe73 100644 (file)
 #include <string>
 #include <ctime>
 
+#include "common/macros.h"
+
 namespace Csr {
 
 // set/get key-value pairs. Key should be defined in each derived classes
-class KvpContainer {
+class API KvpContainer {
 public:
        virtual ~KvpContainer() = default;
 
diff --git a/src/framework/common/macros.h b/src/framework/common/macros.h
new file mode 100644 (file)
index 0000000..926dbb2
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License
+ */
+/*
+ * @file        macros.h
+ * @author      Kyungwook Tak (k.tak@samsung.com)
+ * @version     1.0
+ * @brief       Preprocessor macros
+ */
+#pragma once
+
+#define API __attribute__((visibility("default")))
index a3627cc..05b50cc 100644 (file)
 #include <mutex>
 #include <unordered_map>
 
+#include "common/macros.h"
+
 namespace Csr {
 
-class Mainloop {
+class API Mainloop {
 public:
-       typedef std::function<void(uint32_t event)> Callback;
+       using Callback = std::function<void(uint32_t event)>;
 
        Mainloop();
        virtual ~Mainloop();
index aa7605f..b11baea 100644 (file)
 #include <set>
 #include <memory>
 
-#include "common/command-id.h"
 #include <csr-error.h>
 
+#include "common/macros.h"
+#include "common/command-id.h"
+
 namespace Csr {
 
 // Abstract data stream buffer
@@ -46,7 +48,7 @@ public:
 };
 
 // Serializable interface
-class ISerializable {
+class API ISerializable {
 public:
        ISerializable() {}
        ISerializable(IStream &) {}
index 0daae1d..c405285 100644 (file)
@@ -25,6 +25,7 @@
 #include <functional>
 #include <set>
 
+#include "common/macros.h"
 #include "common/connection.h"
 #include "common/mainloop.h"
 #include "common/socket-descriptor.h"
@@ -33,7 +34,7 @@ namespace Csr {
 
 using ConnCallback = std::function<void(const ConnShPtr &)>;
 
-class Service {
+class API Service {
 public:
        Service();
        virtual ~Service() = default;
index fb0b582..7ad1fe0 100644 (file)
@@ -24,6 +24,8 @@
 #include <map>
 #include <string>
 
+#include "common/macros.h"
+
 namespace Csr {
 
 enum class SockId : int {
@@ -33,7 +35,7 @@ enum class SockId : int {
        POPUP = 0x04, // Popup service
 };
 
-struct SocketDescriptor {
+struct API SocketDescriptor {
        const std::string path;
        const std::string privilege;
        const std::string label;
@@ -43,6 +45,7 @@ struct SocketDescriptor {
                                         const std::string &label);
 };
 
+API
 const SocketDescriptor &getSockDesc(const SockId &);
 
 }
index f890697..a896307 100644 (file)
 
 #include <string>
 
+#include "common/macros.h"
 #include "common/types.h"
 #include "common/socket-descriptor.h"
 
 namespace Csr {
 
-class Socket {
+class API Socket {
 public:
        // Socket with accepted / connected
        Socket(SockId sockId, int fd);
index 409f5c8..7c9b5f5 100644 (file)
 #include <string>
 #include <memory>
 
-#include "common/icontext.h"
 #include <csr-web-protection-types.h>
 
+#include "common/macros.h"
+#include "common/icontext.h"
+
 namespace Csr {
 
 struct WpContext;
 using WpContextPtr = std::unique_ptr<WpContext>;
 using WpContextShPtr = std::shared_ptr<WpContext>;
 
-struct WpContext : public IContext {
+struct API WpContext : public IContext {
        enum class Key : int {
                PopupMessage = 0x01, // string
                AskUser      = 0x10, // int
index e40aaf0..2c2ba99 100644 (file)
 
 #include <string>
 
-#include "common/iresult.h"
 #include <csr-web-protection-types.h>
 
+#include "common/macros.h"
+#include "common/iresult.h"
+
 namespace Csr {
 
-struct WpResult : public IResult {
+struct API WpResult : public IResult {
        WpResult() noexcept;
        virtual ~WpResult() = default;
 
index 31593c4..b893aa5 100644 (file)
@@ -21,8 +21,8 @@
  */
 #pragma once
 
-#include "common/socket-descriptor.h"
 #include "common/connection.h"
+#include "common/socket-descriptor.h"
 
 namespace Csr {