diff options
author | kyungwook tak <k.tak@samsung.com> | 2015-02-03 12:46:56 +0900 |
---|---|---|
committer | Maciej J. Karpiuk <m.karpiuk2@samsung.com> | 2015-02-17 12:12:14 +0100 |
commit | e1f8a9401612213482811f9df1a42366ecf362ec (patch) | |
tree | c77c472baaef82dabc362d6bdedf6291196d5170 | |
parent | 6e0deebe4acc949b6fc1e71f5e9250afdced5876 (diff) | |
download | key-manager-e1f8a9401612213482811f9df1a42366ecf362ec.tar.gz key-manager-e1f8a9401612213482811f9df1a42366ecf362ec.tar.bz2 key-manager-e1f8a9401612213482811f9df1a42366ecf362ec.zip |
Symbol visibility changed from default to hidden.
Change-Id: I9b4b7e8af5ff62cd8c063a0ce45a899f166566d7
Signed-off-by: kyungwook tak <k.tak@samsung.com>
38 files changed, 130 insertions, 72 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d198f18b..ce4dd6be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -102,7 +102,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CLIENT} SHARED ${KEY_MANAGER_CLIENT_SOURCES}) SET_TARGET_PROPERTIES( ${TARGET_KEY_MANAGER_CLIENT} PROPERTIES - COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default" + COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden" SOVERSION ${KEY_MANAGER_CLIENT_VERSION_MAJOR} VERSION ${KEY_MANAGER_CLIENT_VERSION} ) @@ -140,7 +140,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_CONTROL_CLIENT} SHARED ${KEY_MANAGER_CONTROL_CL SET_TARGET_PROPERTIES( ${TARGET_KEY_MANAGER_CONTROL_CLIENT} PROPERTIES - COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default" + COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden" SOVERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION_MAJOR} VERSION ${KEY_MANAGER_CONTROL_CLIENT_VERSION} ) diff --git a/src/include/ckm/ckm-certificate.h b/src/include/ckm/ckm-certificate.h index f76b9797..f7ec2233 100644 --- a/src/include/ckm/ckm-certificate.h +++ b/src/include/ckm/ckm-certificate.h @@ -37,7 +37,7 @@ namespace CKM { class Certificate; typedef std::shared_ptr<Certificate> CertificateShPtr; -class Certificate { +class KEY_MANAGER_API Certificate { public: virtual bool empty() const = 0; diff --git a/src/include/ckm/ckm-control.h b/src/include/ckm/ckm-control.h index b9357847..67250fe4 100644 --- a/src/include/ckm/ckm-control.h +++ b/src/include/ckm/ckm-control.h @@ -34,7 +34,7 @@ class Control; typedef std::shared_ptr<Control> ControlShPtr; // used by login manager to unlock user data with global password -class Control +class KEY_MANAGER_API Control { public: // decrypt user key with password diff --git a/src/include/ckm/ckm-key.h b/src/include/ckm/ckm-key.h index 6cadb66f..718f3823 100644 --- a/src/include/ckm/ckm-key.h +++ b/src/include/ckm/ckm-key.h @@ -28,7 +28,7 @@ namespace CKM { class Key; typedef std::shared_ptr<Key> KeyShPtr; -class Key { +class KEY_MANAGER_API Key { public: virtual bool empty() const = 0; virtual KeyType getType() const = 0; diff --git a/src/include/ckm/ckm-manager-async.h b/src/include/ckm/ckm-manager-async.h index 6978aaaf..bd7b002b 100644 --- a/src/include/ckm/ckm-manager-async.h +++ b/src/include/ckm/ckm-manager-async.h @@ -34,7 +34,7 @@ namespace CKM { // Asynchronous interface to Central Key Manager. This implementation uses // internal thread for connection. Key Manager is not thread safe. -class ManagerAsync +class KEY_MANAGER_API ManagerAsync { public: class Impl; diff --git a/src/include/ckm/ckm-manager.h b/src/include/ckm/ckm-manager.h index bf633a66..03b32d3e 100644 --- a/src/include/ckm/ckm-manager.h +++ b/src/include/ckm/ckm-manager.h @@ -36,7 +36,7 @@ namespace CKM { class Manager; typedef std::shared_ptr<Manager> ManagerShPtr; -class Manager { +class KEY_MANAGER_API Manager { public: virtual ~Manager(){} diff --git a/src/include/ckm/ckm-pkcs12.h b/src/include/ckm/ckm-pkcs12.h index 4c2d5b72..c6e043cd 100644 --- a/src/include/ckm/ckm-pkcs12.h +++ b/src/include/ckm/ckm-pkcs12.h @@ -34,7 +34,7 @@ namespace CKM { class PKCS12; typedef std::shared_ptr<PKCS12> PKCS12ShPtr; -class PKCS12 { +class KEY_MANAGER_API PKCS12 { public: virtual KeyShPtr getKey() const = 0; diff --git a/src/include/ckm/ckm-type.h b/src/include/ckm/ckm-type.h index 482058d4..53b87a78 100644 --- a/src/include/ckm/ckm-type.h +++ b/src/include/ckm/ckm-type.h @@ -27,6 +27,8 @@ #include <ckm/ckm-raw-buffer.h> #include <ckm/ckm-password.h> +#define KEY_MANAGER_API __attribute__((visibility("default"))) + namespace CKM { // used to pass password and raw key data diff --git a/src/include/ckmc/ckmc-type.h b/src/include/ckmc/ckmc-type.h index 3b8f93a2..2a5d20f4 100644 --- a/src/include/ckmc/ckmc-type.h +++ b/src/include/ckmc/ckmc-type.h @@ -42,7 +42,7 @@ extern "C" { * case, separator " " (space bar) is used to separate label and alias. * @see key-manager_doc.h */ -extern char const * const ckmc_label_name_separator; +KEY_MANAGER_CAPI extern char const * const ckmc_label_name_separator; /** * @brief Enumeration for key types of key manager. diff --git a/src/manager/CMakeLists.txt b/src/manager/CMakeLists.txt index e635b889..8c404f14 100644 --- a/src/manager/CMakeLists.txt +++ b/src/manager/CMakeLists.txt @@ -64,7 +64,7 @@ ADD_LIBRARY(${TARGET_KEY_MANAGER_COMMON} SHARED ${COMMON_SOURCES}) SET_TARGET_PROPERTIES( ${TARGET_KEY_MANAGER_COMMON} PROPERTIES - COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=default" + COMPILE_FLAGS "-D_GNU_SOURCE -fPIC -fvisibility=hidden" SOVERSION ${KEY_MANAGER_COMMON_VERSION_MAJOR} VERSION ${KEY_MANAGER_COMMON_VERSION} ) diff --git a/src/manager/client-capi/ckmc-error.cpp b/src/manager/client-capi/ckmc-error.cpp index 715bb2bd..8ea2591a 100644 --- a/src/manager/client-capi/ckmc-error.cpp +++ b/src/manager/client-capi/ckmc-error.cpp @@ -22,8 +22,10 @@ #include <ckmc/ckmc-error.h> #include <ckm/ckm-type.h> +#include <ckmc/ckmc-type.h> #include <ckmc-type-converter.h> +KEY_MANAGER_CAPI const char * ckmc_error_to_string(int error) { return CKM::ErrorToString(to_ckm_error(error)); } diff --git a/src/manager/client-capi/ckmc-type.cpp b/src/manager/client-capi/ckmc-type.cpp index cca44588..33252843 100644 --- a/src/manager/client-capi/ckmc-type.cpp +++ b/src/manager/client-capi/ckmc-type.cpp @@ -391,6 +391,7 @@ int ckmc_load_from_pkcs12_file(const char *file_path, const char *passphrase, ck return CKMC_ERROR_NONE; } +KEY_MANAGER_CAPI int ckmc_load_from_pkcs12_file2(const char *file_path, const char *passphrase, ckmc_pkcs12_s **pkcs12_bundle) { int ec; diff --git a/src/manager/client/client-common.h b/src/manager/client/client-common.h index 06cddf72..4d173a7d 100644 --- a/src/manager/client/client-common.h +++ b/src/manager/client/client-common.h @@ -36,8 +36,6 @@ #include <message-buffer.h> #include <protocols.h> -#define KEY_MANAGER_API __attribute__((visibility("default"))) - extern "C" { struct msghdr; } diff --git a/src/manager/common/base64.h b/src/manager/common/base64.h index 70169cb8..cc5f4a56 100644 --- a/src/manager/common/base64.h +++ b/src/manager/common/base64.h @@ -22,12 +22,14 @@ #include <ckm/ckm-type.h> +#include <symbol-visibility.h> + struct bio_st; typedef bio_st BIO; namespace CKM { -class Base64Encoder : public CKM::Noncopyable +class COMMON_API Base64Encoder : public CKM::Noncopyable { public: class Exception @@ -51,7 +53,7 @@ class Base64Encoder : public CKM::Noncopyable bool m_finalized; }; -class Base64Decoder : public CKM::Noncopyable +class COMMON_API Base64Decoder : public CKM::Noncopyable { public: class Exception diff --git a/src/manager/common/certificate-config.h b/src/manager/common/certificate-config.h index b9d053d8..3873e7ae 100644 --- a/src/manager/common/certificate-config.h +++ b/src/manager/common/certificate-config.h @@ -21,12 +21,13 @@ #include <set> #include <string> +#include <symbol-visibility.h> #pragma once namespace CKM { -class CertificateConfig +class COMMON_API CertificateConfig { public: static void addSystemCertificateDir(const std::string& dir) { m_sysCertDirs.insert(dir); } diff --git a/src/manager/common/certificate-impl.h b/src/manager/common/certificate-impl.h index 48ae5b7c..e66f5eaa 100644 --- a/src/manager/common/certificate-impl.h +++ b/src/manager/common/certificate-impl.h @@ -27,10 +27,11 @@ #include <ckm/ckm-certificate.h> #include <key-impl.h> +#include <symbol-visibility.h> namespace CKM { -class CertificateImpl : public Certificate { +class COMMON_API CertificateImpl : public Certificate { public: CertificateImpl() : m_x509(NULL) {} explicit CertificateImpl(X509* x509, bool duplicate = true); diff --git a/src/manager/common/certificate-store.h b/src/manager/common/certificate-store.h index 250e05ea..05c42655 100644 --- a/src/manager/common/certificate-store.h +++ b/src/manager/common/certificate-store.h @@ -19,6 +19,7 @@ * @brief Certificate Stack Implmentation. */ #include <certificate-impl.h> +#include <symbol-visibility.h> extern "C" { struct x509_store_st; @@ -27,7 +28,7 @@ typedef struct x509_store_st X509_STORE; namespace CKM { -class CertificateStore { +class COMMON_API CertificateStore { public: CertificateStore(); CertificateStore(const CertificateStore &) = delete; diff --git a/src/manager/common/crypto.h b/src/manager/common/crypto.h index 6d4df06b..44b9f0a0 100644 --- a/src/manager/common/crypto.h +++ b/src/manager/common/crypto.h @@ -28,12 +28,14 @@ #include <dpl/exception.h> #include <dpl/raw-buffer.h> +#include <symbol-visibility.h> + // TODO move it to static const int #define AES_GCM_TAG_SIZE 16 namespace CKM { -void initCryptoLib(); +COMMON_API void initCryptoLib(); namespace Crypto { @@ -47,7 +49,7 @@ public: namespace Cipher { template<class T> -struct Base { +struct COMMON_API Base { Base() : m_ctx(EVP_CIPHER_CTX_new()) { @@ -74,7 +76,7 @@ protected: }; template<class T> -class EvpCipherWrapper : public Base<T> { +class COMMON_API EvpCipherWrapper : public Base<T> { public: using Base<T>::m_ctx; @@ -127,7 +129,7 @@ public: }; #define DEFINE_CIPHER(__classname, __type, __evpcipher, __encryption) \ -class __classname : public EvpCipherWrapper<__type> { \ +class COMMON_API __classname : public EvpCipherWrapper<__type> { \ public: \ __classname(const __type &key, const __type &iv) \ : EvpCipherWrapper(__evpcipher, key, iv, __encryption) \ diff --git a/src/manager/common/descriptor-set.h b/src/manager/common/descriptor-set.h index 7e166bab..714d6dfd 100644 --- a/src/manager/common/descriptor-set.h +++ b/src/manager/common/descriptor-set.h @@ -26,6 +26,7 @@ #include <dpl/exception.h> #include <poll.h> #include <noncopyable.h> +#include <symbol-visibility.h> namespace CKM { @@ -46,7 +47,7 @@ protected: /** * @brief Wrapper for poll() */ -class DescriptorSet : public IDescriptorSet +class COMMON_API DescriptorSet : public IDescriptorSet { public: DescriptorSet(); diff --git a/src/manager/common/digest.h b/src/manager/common/digest.h index e8903294..a07a79f4 100644 --- a/src/manager/common/digest.h +++ b/src/manager/common/digest.h @@ -19,6 +19,7 @@ #include <dpl/noncopyable.h> #include <dpl/exception.h> #include <ckm/ckm-type.h> +#include <symbol-visibility.h> /* * Taken from openssl/ossl_typ.h @@ -30,7 +31,7 @@ typedef env_md_st EVP_MD; namespace CKM { -class Digest : public CKM::Noncopyable +class COMMON_API Digest : public CKM::Noncopyable { public: class Exception diff --git a/src/manager/common/file-lock.h b/src/manager/common/file-lock.h index b56e29a8..b2c3ec3a 100644 --- a/src/manager/common/file-lock.h +++ b/src/manager/common/file-lock.h @@ -22,10 +22,11 @@ #pragma once #include <noncopyable.h> +#include <symbol-visibility.h> namespace CKM { -class FileLock +class COMMON_API FileLock { public: explicit FileLock(const char* const file); diff --git a/src/manager/common/key-impl.h b/src/manager/common/key-impl.h index 9d7831a4..b40c586d 100644 --- a/src/manager/common/key-impl.h +++ b/src/manager/common/key-impl.h @@ -25,10 +25,11 @@ #include <ckm/ckm-type.h> #include <ckm/ckm-key.h> #include <openssl/evp.h> +#include <symbol-visibility.h> namespace CKM { -class KeyImpl : public Key { +class COMMON_API KeyImpl : public Key { public: typedef std::shared_ptr<EVP_PKEY> EvpShPtr; diff --git a/src/manager/common/message-buffer.h b/src/manager/common/message-buffer.h index 4112f437..798056ea 100644 --- a/src/manager/common/message-buffer.h +++ b/src/manager/common/message-buffer.h @@ -29,12 +29,12 @@ #include <dpl/binary_queue.h> #include <dpl/exception.h> #include <dpl/serialization.h> - #include <dpl/raw-buffer.h> +#include <symbol-visibility.h> namespace CKM { -class MessageBuffer : public CKM::IStream { +class COMMON_API MessageBuffer : public CKM::IStream { public: class Exception { diff --git a/src/manager/common/pkcs12-impl.h b/src/manager/common/pkcs12-impl.h index 6980f5cc..9712829d 100644 --- a/src/manager/common/pkcs12-impl.h +++ b/src/manager/common/pkcs12-impl.h @@ -23,10 +23,11 @@ #include <memory> #include <ckm/ckm-pkcs12.h> +#include <symbol-visibility.h> namespace CKM { -class PKCS12Impl : public PKCS12 { +class COMMON_API PKCS12Impl : public PKCS12 { public: PKCS12Impl() {} explicit PKCS12Impl(const PKCS12 &); diff --git a/src/manager/common/protocols.h b/src/manager/common/protocols.h index fe1fd53b..fa6c8a43 100644 --- a/src/manager/common/protocols.h +++ b/src/manager/common/protocols.h @@ -30,13 +30,14 @@ #include <dpl/exception.h> #include <dpl/serialization.h> +#include <symbol-visibility.h> namespace CKM { -extern char const * const SERVICE_SOCKET_ECHO; -extern char const * const SERVICE_SOCKET_CKM_CONTROL; -extern char const * const SERVICE_SOCKET_CKM_STORAGE; -extern char const * const SERVICE_SOCKET_OCSP; +COMMON_API extern char const * const SERVICE_SOCKET_ECHO; +COMMON_API extern char const * const SERVICE_SOCKET_CKM_CONTROL; +COMMON_API extern char const * const SERVICE_SOCKET_CKM_STORAGE; +COMMON_API extern char const * const SERVICE_SOCKET_OCSP; enum class ControlCommand : int { UNLOCK_USER_KEY, @@ -68,7 +69,7 @@ enum class LogicCommand : int { // for backward compatibility append new at the end }; -class DataType { +class COMMON_API DataType { public: class Exception { public: @@ -238,13 +239,13 @@ private: }; // (client side) Alias = (service side) Label::Name -extern char const * const LABEL_NAME_SEPARATOR; +COMMON_API extern char const * const LABEL_NAME_SEPARATOR; typedef std::string Name; typedef std::vector<std::pair<Label, Name> > LabelNameVector; class IStream; -struct PolicySerializable : public Policy, ISerializable { +struct COMMON_API PolicySerializable : public Policy, ISerializable { PolicySerializable() {}; explicit PolicySerializable(const Policy &policy) : Policy(policy) {} explicit PolicySerializable(IStream &stream) { @@ -257,7 +258,7 @@ struct PolicySerializable : public Policy, ISerializable { } }; -struct PKCS12Serializable : public PKCS12Impl, ISerializable { +struct COMMON_API PKCS12Serializable : public PKCS12Impl, ISerializable { PKCS12Serializable(); explicit PKCS12Serializable(const PKCS12 &); explicit PKCS12Serializable(IStream &); diff --git a/src/manager/common/smack-check.h b/src/manager/common/smack-check.h index 942578b3..8c998f00 100644 --- a/src/manager/common/smack-check.h +++ b/src/manager/common/smack-check.h @@ -21,6 +21,8 @@ #ifndef _SMACK_CHECK_H_ #define _SMACK_CHECK_H_ +#include <symbol-visibility.h> + namespace CKM { /* @@ -35,6 +37,7 @@ int smack_runtime_check(void); * Returns 1 if SMACK is present, 0 otherwise. If SMACK_ENABLED is not defined * It returns 0. */ +COMMON_API int smack_check(void); } // namespace CKM diff --git a/src/manager/common/symbol-visibility.h b/src/manager/common/symbol-visibility.h new file mode 100644 index 00000000..78cdd5a3 --- /dev/null +++ b/src/manager/common/symbol-visibility.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2000 - 2013 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 symbol-visibility.h + * @author Kyungwook Tak (k.tak@samsung.com) + * @version 1.0 + * @brief define symbol visiblity for common library. + */ + +#define COMMON_API __attribute__((visibility("default"))) diff --git a/src/manager/dpl/core/include/dpl/assert.h b/src/manager/dpl/core/include/dpl/assert.h index ad0205da..38ecd813 100644 --- a/src/manager/dpl/core/include/dpl/assert.h +++ b/src/manager/dpl/core/include/dpl/assert.h @@ -24,12 +24,13 @@ #include <dpl/noreturn.h> #include <string> +#include <symbol-visibility.h> namespace CKM { // Assertion handler procedure // Do not call directly // Always use Assert macro -CENT_KEY_NORETURN void AssertProc(const char *condition, +COMMON_API CENT_KEY_NORETURN void AssertProc(const char *condition, const char *file, int line, const char *function); diff --git a/src/manager/dpl/core/include/dpl/binary_queue.h b/src/manager/dpl/core/include/dpl/binary_queue.h index 79b3d65c..eff8955c 100644 --- a/src/manager/dpl/core/include/dpl/binary_queue.h +++ b/src/manager/dpl/core/include/dpl/binary_queue.h @@ -27,6 +27,7 @@ #include <dpl/noncopyable.h> #include <memory> #include <list> +#include <symbol-visibility.h> namespace CKM { /** @@ -40,7 +41,7 @@ typedef std::auto_ptr<BinaryQueue> BinaryQueueAutoPtr; * * @todo Add optimized implementation for FlattenConsume */ -class BinaryQueue +class COMMON_API BinaryQueue // : public AbstractInputOutput { public: diff --git a/src/manager/dpl/core/include/dpl/colors.h b/src/manager/dpl/core/include/dpl/colors.h index 5750425d..0ac301fd 100644 --- a/src/manager/dpl/core/include/dpl/colors.h +++ b/src/manager/dpl/core/include/dpl/colors.h @@ -24,28 +24,30 @@ #ifndef CKM_COLORS_H #define CKM_COLORS_H +#include <symbol-visibility.h> + namespace CKM { namespace Colors { namespace Text { -extern const char* BOLD_GREEN_BEGIN; -extern const char* BOLD_GREEN_END; -extern const char* PURPLE_BEGIN; -extern const char* PURPLE_END; -extern const char* RED_BEGIN; -extern const char* RED_END; -extern const char* GREEN_BEGIN; -extern const char* GREEN_END; -extern const char* CYAN_BEGIN; -extern const char* CYAN_END; -extern const char* BOLD_RED_BEGIN; -extern const char* BOLD_RED_END; -extern const char* BOLD_YELLOW_BEGIN; -extern const char* BOLD_YELLOW_END; -extern const char* BOLD_GOLD_BEGIN; -extern const char* BOLD_GOLD_END; -extern const char* BOLD_WHITE_BEGIN; -extern const char* BOLD_WHITE_END; -extern const char* COLOR_END; +COMMON_API extern const char* BOLD_GREEN_BEGIN; +COMMON_API extern const char* BOLD_GREEN_END; +COMMON_API extern const char* PURPLE_BEGIN; +COMMON_API extern const char* PURPLE_END; +COMMON_API extern const char* RED_BEGIN; +COMMON_API extern const char* RED_END; +COMMON_API extern const char* GREEN_BEGIN; +COMMON_API extern const char* GREEN_END; +COMMON_API extern const char* CYAN_BEGIN; +COMMON_API extern const char* CYAN_END; +COMMON_API extern const char* BOLD_RED_BEGIN; +COMMON_API extern const char* BOLD_RED_END; +COMMON_API extern const char* BOLD_YELLOW_BEGIN; +COMMON_API extern const char* BOLD_YELLOW_END; +COMMON_API extern const char* BOLD_GOLD_BEGIN; +COMMON_API extern const char* BOLD_GOLD_END; +COMMON_API extern const char* BOLD_WHITE_BEGIN; +COMMON_API extern const char* BOLD_WHITE_END; +COMMON_API extern const char* COLOR_END; } //namespace Text } //namespace Colors } //namespace CKM diff --git a/src/manager/dpl/core/include/dpl/errno_string.h b/src/manager/dpl/core/include/dpl/errno_string.h index fe93e905..866f6eaa 100644 --- a/src/manager/dpl/core/include/dpl/errno_string.h +++ b/src/manager/dpl/core/include/dpl/errno_string.h @@ -25,11 +25,12 @@ #include <dpl/exception.h> #include <string> #include <cerrno> +#include <symbol-visibility.h> namespace CKM { DECLARE_EXCEPTION_TYPE(CKM::Exception, InvalidErrnoValue) -std::string GetErrnoString(int error = errno); +COMMON_API std::string GetErrnoString(int error = errno); } // namespace CKM #endif // CKM_ERRNO_STRING_H diff --git a/src/manager/dpl/core/include/dpl/exception.h b/src/manager/dpl/core/include/dpl/exception.h index c2a0ff37..9a2d85d0 100644 --- a/src/manager/dpl/core/include/dpl/exception.h +++ b/src/manager/dpl/core/include/dpl/exception.h @@ -28,17 +28,18 @@ #include <exception> #include <cstdlib> #include <sstream> +#include <symbol-visibility.h> namespace CKM { -void LogUnhandledException(const std::string &str); -void LogUnhandledException(const std::string &str, +COMMON_API void LogUnhandledException(const std::string &str); +COMMON_API void LogUnhandledException(const std::string &str, const char *filename, int line, const char *function); } namespace CKM { -class Exception +class COMMON_API Exception { private: static unsigned int m_exceptionCount; diff --git a/src/manager/dpl/core/include/dpl/fstream_accessors.h b/src/manager/dpl/core/include/dpl/fstream_accessors.h index b1aa17c6..ca0b66db 100644 --- a/src/manager/dpl/core/include/dpl/fstream_accessors.h +++ b/src/manager/dpl/core/include/dpl/fstream_accessors.h @@ -25,6 +25,8 @@ #ifndef CENT_KEY_FSTREAM_ACCESSORS_H #define CENT_KEY_FSTREAM_ACCESSORS_H +#include <symbol-visibility.h> + namespace CKM { /* @@ -35,7 +37,7 @@ namespace CKM { */ template<typename T> -class FstreamAccessors : T::__filebuf_type { +class COMMON_API FstreamAccessors : T::__filebuf_type { typedef FstreamAccessors<T> MyType; public: static int GetFd(T &strm) { diff --git a/src/manager/dpl/core/include/dpl/noncopyable.h b/src/manager/dpl/core/include/dpl/noncopyable.h index abc77a31..138a0aa7 100644 --- a/src/manager/dpl/core/include/dpl/noncopyable.h +++ b/src/manager/dpl/core/include/dpl/noncopyable.h @@ -22,8 +22,10 @@ #ifndef CENT_KEY_NONCOPYABLE_H #define CENT_KEY_NONCOPYABLE_H +#include <symbol-visibility.h> + namespace CKM { -class Noncopyable +class COMMON_API Noncopyable { private: Noncopyable(const Noncopyable &); diff --git a/src/manager/dpl/core/include/dpl/singleton.h b/src/manager/dpl/core/include/dpl/singleton.h index ff713a45..93831aa8 100644 --- a/src/manager/dpl/core/include/dpl/singleton.h +++ b/src/manager/dpl/core/include/dpl/singleton.h @@ -22,9 +22,11 @@ #ifndef CENT_KEY_SINGLETON_H #define CENT_KEY_SINGLETON_H +#include <symbol-visibility.h> + namespace CKM { template<typename Class> -class Singleton : +class COMMON_API Singleton : private Class { // diff --git a/src/manager/dpl/db/include/dpl/db/sql_connection.h b/src/manager/dpl/db/include/dpl/db/sql_connection.h index ecec0b04..e657445f 100644 --- a/src/manager/dpl/db/include/dpl/db/sql_connection.h +++ b/src/manager/dpl/db/include/dpl/db/sql_connection.h @@ -35,12 +35,14 @@ #include <stdint.h> #include <dpl/raw-buffer.h> +#include <symbol-visibility.h> + namespace CKM { namespace DB { /** * SQL connection class */ -class SqlConnection +class COMMON_API SqlConnection { public: /** diff --git a/src/manager/dpl/log/include/dpl/log/log.h b/src/manager/dpl/log/include/dpl/log/log.h index 83fd0d80..ec93e8fb 100644 --- a/src/manager/dpl/log/include/dpl/log/log.h +++ b/src/manager/dpl/log/include/dpl/log/log.h @@ -28,12 +28,14 @@ #include <sstream> #include <list> +#include <symbol-visibility.h> + namespace CKM { namespace Log { /** * CKM log system */ -class LogSystem : private Noncopyable +class COMMON_API LogSystem : private Noncopyable { public: LogSystem(); diff --git a/src/manager/sqlcipher/sqlcipher.c b/src/manager/sqlcipher/sqlcipher.c index 0676c941..a0752e8e 100644 --- a/src/manager/sqlcipher/sqlcipher.c +++ b/src/manager/sqlcipher/sqlcipher.c @@ -13059,7 +13059,7 @@ SQLCIPHER_API int sqlcipher3_rekey(sqlcipher3 *db, const void *pKey, int nKey) { */ rc = sqlcipher3BtreeBeginTrans(pDb->pBt, 1); /* begin write transaction */ sqlcipher3PagerPagecount(pPager, &page_count); - for(pgno = 1; rc == SQLCIPHER_OK && pgno <= page_count; pgno++) { /* pgno's start at 1 see pager.c:pagerAcquire */ + for(pgno = 1; rc == SQLCIPHER_OK && (int)pgno <= page_count; pgno++) { /* pgno's start at 1 see pager.c:pagerAcquire */ if(!sqlcipher3pager_is_mj_pgno(pPager, pgno)) { /* skip this page (see pager.c:pagerAcquire for reasoning) */ rc = sqlcipher3PagerGet(pPager, pgno, &page); if(rc == SQLCIPHER_OK) { /* write page see pager_incr_changecounter for example */ @@ -57939,7 +57939,7 @@ static int backupOnePage(sqlcipher3_backup *p, Pgno iSrcPg, const u8 *zSrcData){ if( nSrcReserve!=nDestReserve ){ u32 newPgsz = nSrcPgsz; rc = sqlcipher3PagerSetPagesize(pDestPager, &newPgsz, nSrcReserve); - if( rc==SQLCIPHER_OK && newPgsz!=nSrcPgsz ) rc = SQLCIPHER_READONLY; + if( rc==SQLCIPHER_OK && (int)newPgsz!=nSrcPgsz ) rc = SQLCIPHER_READONLY; } #endif @@ -80181,8 +80181,8 @@ static void attachFunc( if( rc==SQLCIPHER_OK ){ extern int sqlcipher3CodecAttach(sqlcipher3*, int, const void*, int); extern void sqlcipher3CodecGetKey(sqlcipher3*, int, void**, int*); - int nKey; - char *zKey; + int nKey = 0; + char *zKey = NULL; int t = sqlcipher3_value_type(argv[2]); switch( t ){ case SQLCIPHER_INTEGER: @@ -100874,8 +100874,8 @@ SQLCIPHER_PRIVATE int sqlcipher3RunVacuum(char **pzErrMsg, sqlcipher3 *db){ #ifdef SQLCIPHER_HAS_CODEC if( db->nextPagesize ){ extern void sqlcipher3CodecGetKey(sqlcipher3*, int, void**, int*); - int nKey; - char *zKey; + int nKey = 0; + char *zKey = NULL; sqlcipher3CodecGetKey(db, 0, (void**)&zKey, &nKey); if( nKey ) db->nextPagesize = 0; } |