From: Sungbae Yoo Date: Mon, 27 Nov 2017 08:23:42 +0000 (+0900) Subject: Change default fvisibility to hidden X-Git-Tag: submit/tizen_4.0/20171129.062733~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a19417047791ae0c97dd2422e7f64c66dca0b5f9;p=platform%2Fcore%2Fsecurity%2Fklay.git Change default fvisibility to hidden Signed-off-by: Sungbae Yoo Change-Id: I49581e81def9d2d80883a4e7d0a25282100a1c58 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 36c5dc5..fccbd86 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ EXECUTE_PROCESS(COMMAND getconf LFS_CFLAGS OUTPUT_VARIABLE LFS_CFLAGS OUTPUT_STR EXECUTE_PROCESS(COMMAND getconf LFS_LDFLAGS OUTPUT_VARIABLE LFS_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) EXECUTE_PROCESS(COMMAND getconf LFS_LIBS OUTPUT_VARIABLE LFS_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) -SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive ${LFS_CFLAGS}") +SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive -fvisibility=hidden -fvisibility-inlines-hidden ${LFS_CFLAGS}") SET(CMAKE_C_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg") SET(CMAKE_CXX_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg -std=${CXX_STD} -fno-rtti") diff --git a/include/klay/audit/audit-trail.h b/include/klay/audit/audit-trail.h index 0b25c75..dcfd298 100644 --- a/include/klay/audit/audit-trail.h +++ b/include/klay/audit/audit-trail.h @@ -17,6 +17,8 @@ #ifndef __AUDIT_TRAIL_H__ #define __AUDIT_TRAIL_H__ +#include + #include #include @@ -24,7 +26,7 @@ namespace audit { -class AuditTrail { +class KLAY_EXPORT AuditTrail { public: AuditTrail(); ~AuditTrail(); diff --git a/include/klay/audit/console-sink.h b/include/klay/audit/console-sink.h index 85dbe27..a57db77 100644 --- a/include/klay/audit/console-sink.h +++ b/include/klay/audit/console-sink.h @@ -23,7 +23,7 @@ namespace audit { -class ConsoleLogSink : public LogSink { +class KLAY_EXPORT ConsoleLogSink : public LogSink { public: void sink(const std::string& message) override; }; diff --git a/include/klay/audit/dlog-sink.h b/include/klay/audit/dlog-sink.h index cff29f2..3313100 100644 --- a/include/klay/audit/dlog-sink.h +++ b/include/klay/audit/dlog-sink.h @@ -23,7 +23,7 @@ namespace audit { -class DlogLogSink : public LogSink { +class KLAY_EXPORT DlogLogSink : public LogSink { public: explicit DlogLogSink(const std::string& tag); void sink(const std::string& message) override; diff --git a/include/klay/audit/logger-core.h b/include/klay/audit/logger-core.h index 2cca42c..ae28d3e 100644 --- a/include/klay/audit/logger-core.h +++ b/include/klay/audit/logger-core.h @@ -25,7 +25,7 @@ namespace audit { -class LoggerCore { +class KLAY_EXPORT LoggerCore { public: LoggerCore(); virtual ~LoggerCore() = default; diff --git a/include/klay/audit/logger.h b/include/klay/audit/logger.h index 739cfaf..5282be5 100644 --- a/include/klay/audit/logger.h +++ b/include/klay/audit/logger.h @@ -27,7 +27,7 @@ namespace audit { -enum class LogLevel : int { +enum class KLAY_EXPORT LogLevel : int { Silent, Error, Warning, @@ -36,7 +36,7 @@ enum class LogLevel : int { Trace }; -struct LogRecord { +struct KLAY_EXPORT LogRecord { LogLevel severity; std::string file; unsigned int line; @@ -44,13 +44,13 @@ struct LogRecord { std::string message; }; -class Logger { +class KLAY_EXPORT Logger { public: static void log(LogSink* logSink, const LogRecord record); }; -std::string LogLevelToString(const LogLevel level); -LogLevel StringToLogLevel(const std::string& level); +KLAY_EXPORT std::string LogLevelToString(const LogLevel level); +KLAY_EXPORT LogLevel StringToLogLevel(const std::string& level); #ifndef __FILENAME__ #define __FILENAME__ \ diff --git a/include/klay/audit/logsink.h b/include/klay/audit/logsink.h index f1949df..83f1915 100644 --- a/include/klay/audit/logsink.h +++ b/include/klay/audit/logsink.h @@ -17,11 +17,13 @@ #ifndef __AUDIT_LOGSINK_H__ #define __AUDIT_LOGSINK_H__ +#include + #include namespace audit { -class LogSink { +class KLAY_EXPORT LogSink { public: LogSink() {} virtual ~LogSink() {} diff --git a/include/klay/audit/null-sink.h b/include/klay/audit/null-sink.h index cd5d9dc..7429798 100644 --- a/include/klay/audit/null-sink.h +++ b/include/klay/audit/null-sink.h @@ -23,7 +23,7 @@ namespace audit { -class NullLogSink : public LogSink { +class KLAY_EXPORT NullLogSink : public LogSink { public: void sink(const std::string& message) override; }; diff --git a/include/klay/auth/group.h b/include/klay/auth/group.h index 5c0b583..625862a 100644 --- a/include/klay/auth/group.h +++ b/include/klay/auth/group.h @@ -22,13 +22,15 @@ #include +#include + #ifndef INVALID_GID #define INVALID_GID UINT_MAX #endif namespace runtime { -class Group final { +class KLAY_EXPORT Group final { public: Group(const std::string& name); Group(const gid_t group); diff --git a/include/klay/auth/user.h b/include/klay/auth/user.h index 88aa5b0..a5130d9 100644 --- a/include/klay/auth/user.h +++ b/include/klay/auth/user.h @@ -22,13 +22,15 @@ #include +#include + #ifndef INVALID_UID #define INVALID_UID UINT_MAX #endif namespace runtime { -class User final { +class KLAY_EXPORT User final { public: User(const std::string& name); User(const uid_t user); diff --git a/include/klay/cgroup.h b/include/klay/cgroup.h index a9cb217..1b41d45 100644 --- a/include/klay/cgroup.h +++ b/include/klay/cgroup.h @@ -20,9 +20,11 @@ #include #include +#include + namespace runtime { -class Cgroup final { +class KLAY_EXPORT Cgroup final { public: Cgroup() = delete; diff --git a/include/klay/db/column.h b/include/klay/db/column.h index 5a566e8..2b033d4 100644 --- a/include/klay/db/column.h +++ b/include/klay/db/column.h @@ -21,11 +21,12 @@ #include +#include #include namespace database { -class Column { +class KLAY_EXPORT Column { public: Column(const Statement& stmt, int idx); virtual ~Column() noexcept; diff --git a/include/klay/db/connection.h b/include/klay/db/connection.h index 3f2eaa5..641310b 100644 --- a/include/klay/db/connection.h +++ b/include/klay/db/connection.h @@ -21,9 +21,11 @@ #include +#include + namespace database { -class Connection { +class KLAY_EXPORT Connection { public: enum Mode { Create = SQLITE_OPEN_CREATE, diff --git a/include/klay/db/statement.h b/include/klay/db/statement.h index 6c11cef..286de8b 100644 --- a/include/klay/db/statement.h +++ b/include/klay/db/statement.h @@ -22,12 +22,14 @@ #include #include +#include + namespace database { class Column; class Connection; -class Statement { +class KLAY_EXPORT Statement { public: Statement(const Connection& db, const std::string& query); virtual ~Statement(); diff --git a/include/klay/dbus/connection.h b/include/klay/dbus/connection.h index 9f1b1f9..283d63d 100644 --- a/include/klay/dbus/connection.h +++ b/include/klay/dbus/connection.h @@ -23,11 +23,12 @@ #include #include +#include #include namespace dbus { -class Connection { +class KLAY_EXPORT Connection { public: typedef unsigned int NameId; typedef unsigned int ObjectId; diff --git a/include/klay/dbus/error.h b/include/klay/dbus/error.h index ed98df9..a72cfaf 100644 --- a/include/klay/dbus/error.h +++ b/include/klay/dbus/error.h @@ -19,9 +19,11 @@ #include +#include + namespace dbus { -class Error { +class KLAY_EXPORT Error { public: Error(); ~Error(); diff --git a/include/klay/dbus/introspection.h b/include/klay/dbus/introspection.h index 711611e..775cb5d 100644 --- a/include/klay/dbus/introspection.h +++ b/include/klay/dbus/introspection.h @@ -23,6 +23,8 @@ #include #include +#include + namespace dbus { using BusNode = GDBusNodeInfo*; @@ -33,7 +35,7 @@ using Property = GDBusPropertyInfo*; using XmlProperties = std::vector>; -class Introspection { +class KLAY_EXPORT Introspection { public: explicit Introspection(const std::string &xmlData); virtual ~Introspection(void); diff --git a/include/klay/dbus/signal.h b/include/klay/dbus/signal.h index 4415795..9573b8b 100644 --- a/include/klay/dbus/signal.h +++ b/include/klay/dbus/signal.h @@ -17,9 +17,11 @@ #ifndef __RUNTIME_DBUS_SIGNAL_H__ #define __RUNTIME_DBUS_SIGNAL_H__ + #include #include +#include #include namespace dbus { @@ -27,7 +29,7 @@ namespace signal { using SignalCallback = dbus::Connection::SignalCallback; -class Sender { +class KLAY_EXPORT Sender { public: explicit Sender(const std::string &objectPath, const std::string &interfaceName); virtual ~Sender(void) = default; @@ -50,7 +52,7 @@ private: std::string interfaceName; }; -class Receiver { +class KLAY_EXPORT Receiver { public: explicit Receiver(const std::string &objectPath, const std::string &interfaceName); virtual ~Receiver(void) = default; diff --git a/include/klay/dbus/variant.h b/include/klay/dbus/variant.h index 5d0b193..cd81660 100644 --- a/include/klay/dbus/variant.h +++ b/include/klay/dbus/variant.h @@ -21,9 +21,11 @@ #include +#include + namespace dbus { -class Variant { +class KLAY_EXPORT Variant { public: Variant(); Variant(GVariant* var); @@ -40,7 +42,7 @@ private: GVariant* variant; }; -class VariantIterator { +class KLAY_EXPORT VariantIterator { public: VariantIterator(GVariantIter* it); VariantIterator(VariantIterator&& it); diff --git a/include/klay/error.h b/include/klay/error.h index f746c38..d9ec20d 100644 --- a/include/klay/error.h +++ b/include/klay/error.h @@ -19,17 +19,19 @@ #include +#include + namespace runtime { -class Error { +class KLAY_EXPORT Error { public: static std::string message(); static std::string message(int errorCode); static int lastErrorCode(); }; -std::string GetSystemErrorMessage(); -std::string GetSystemErrorMessage(int errorCode); +KLAY_EXPORT std::string GetSystemErrorMessage(); +KLAY_EXPORT std::string GetSystemErrorMessage(int errorCode); } // namespace runtime #endif //__RUNTIME_ERROR_H__ diff --git a/include/klay/eventfd.h b/include/klay/eventfd.h index a642136..e2560ee 100644 --- a/include/klay/eventfd.h +++ b/include/klay/eventfd.h @@ -19,9 +19,11 @@ #include +#include + namespace runtime { -class EventFD { +class KLAY_EXPORT EventFD { public: EventFD(unsigned int initval = 0, int flags = EFD_SEMAPHORE | EFD_CLOEXEC); ~EventFD(); diff --git a/include/klay/exception.h b/include/klay/exception.h index 81eee69..c91ea96 100644 --- a/include/klay/exception.h +++ b/include/klay/exception.h @@ -20,9 +20,11 @@ #include #include +#include + namespace runtime { -class Exception: public std::runtime_error { +class KLAY_EXPORT Exception: public std::runtime_error { public: Exception(const std::string& error) : std::runtime_error(error) @@ -34,13 +36,13 @@ public: virtual const char *className() const; }; -#define EXCEPTION_DEFINE(CLS) \ - class CLS : public Exception { \ - public: \ - CLS(const std::string& error); \ - ~CLS() {} \ - const char *className() const; \ - const char *name() const; \ +#define EXCEPTION_DEFINE(CLS) \ + class KLAY_EXPORT CLS : public Exception { \ + public: \ + CLS(const std::string& error); \ + ~CLS() {} \ + const char *className() const; \ + const char *name() const; \ }; diff --git a/include/klay/file-descriptor.h b/include/klay/file-descriptor.h index 902e7c6..9991d7d 100644 --- a/include/klay/file-descriptor.h +++ b/include/klay/file-descriptor.h @@ -17,9 +17,11 @@ #ifndef __RUNTIME_FILE_DESCRIPTOR_H__ #define __RUNTIME_FILE_DESCRIPTOR_H__ +#include + namespace runtime { -struct FileDescriptor { +struct KLAY_EXPORT FileDescriptor { FileDescriptor(int fd = -1, bool autoclose = false) : fileDescriptor(fd), autoClose(autoclose) { diff --git a/include/klay/file-user.h b/include/klay/file-user.h index 81d3a39..c57d9d0 100644 --- a/include/klay/file-user.h +++ b/include/klay/file-user.h @@ -20,9 +20,11 @@ #include #include +#include + namespace runtime { -class FileUser final { +class KLAY_EXPORT FileUser final { public: FileUser() = delete; diff --git a/include/klay/filesystem.h b/include/klay/filesystem.h index 3c62f04..68c23e6 100644 --- a/include/klay/filesystem.h +++ b/include/klay/filesystem.h @@ -22,9 +22,11 @@ #include +#include + namespace runtime { -class File { +class KLAY_EXPORT File { public: File() : descriptor(-1) @@ -129,7 +131,7 @@ private: std::string path; }; -class DirectoryIterator { +class KLAY_EXPORT DirectoryIterator { public: DirectoryIterator() : directoryHandle(nullptr) @@ -182,7 +184,7 @@ private: std::string basename; }; -class Mount final { +class KLAY_EXPORT Mount final { public: Mount() = delete; diff --git a/include/klay/gmainloop.h b/include/klay/gmainloop.h index a01bba3..e3743d4 100644 --- a/include/klay/gmainloop.h +++ b/include/klay/gmainloop.h @@ -15,11 +15,14 @@ */ #ifndef __GMAINLOOP_WRAPPER_H__ #define __GMAINLOOP_WRAPPER_H__ + #include #include #include -class ScopedGMainLoop { +#include + +class KLAY_EXPORT ScopedGMainLoop { public: ScopedGMainLoop() : mainloop(g_main_loop_new(NULL, FALSE), g_main_loop_unref) diff --git a/include/klay/klay.h b/include/klay/klay.h new file mode 100644 index 0000000..42169a5 --- /dev/null +++ b/include/klay/klay.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2015 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 + */ + +#ifndef __KLAY_H__ +#define __KLAY_H__ + +#ifndef KLAY_EXPORT +#define KLAY_EXPORT __attribute__((visibility("default"))) +#endif // KLAY_EXPORT + +#endif //__KLAY_H__ diff --git a/include/klay/latch.h b/include/klay/latch.h index c95280b..363871e 100644 --- a/include/klay/latch.h +++ b/include/klay/latch.h @@ -20,9 +20,11 @@ #include #include +#include + namespace runtime { -class Latch { +class KLAY_EXPORT Latch { public: Latch() : count(0) diff --git a/include/klay/mainloop.h b/include/klay/mainloop.h index 3c3f55d..662020f 100644 --- a/include/klay/mainloop.h +++ b/include/klay/mainloop.h @@ -26,11 +26,13 @@ #include #include +#include + #include "eventfd.h" namespace runtime { -class Mainloop { +class KLAY_EXPORT Mainloop { public: typedef unsigned int Event; typedef std::function Callback; diff --git a/include/klay/namespace.h b/include/klay/namespace.h index 1a1a60e..c8a52c9 100644 --- a/include/klay/namespace.h +++ b/include/klay/namespace.h @@ -19,9 +19,11 @@ #include +#include + namespace runtime { -class Namespace final { +class KLAY_EXPORT Namespace final { public: Namespace() = delete; diff --git a/include/klay/netlink/audit-rule.h b/include/klay/netlink/audit-rule.h index 16faaad..b595fd2 100644 --- a/include/klay/netlink/audit-rule.h +++ b/include/klay/netlink/audit-rule.h @@ -21,9 +21,11 @@ #include +#include + namespace netlink { -class AuditRule final { +class KLAY_EXPORT AuditRule final { public: AuditRule(); AuditRule(std::vector& buf); diff --git a/include/klay/netlink/audit.h b/include/klay/netlink/audit.h index 5098d23..b523b23 100644 --- a/include/klay/netlink/audit.h +++ b/include/klay/netlink/audit.h @@ -22,13 +22,14 @@ #include +#include #include #include #include namespace netlink { -class Audit final { +class KLAY_EXPORT Audit final { public: typedef std::pair> Message; typedef std::function MessageHandler; diff --git a/include/klay/netlink/netlink.h b/include/klay/netlink/netlink.h index 0e12e11..9fdc648 100644 --- a/include/klay/netlink/netlink.h +++ b/include/klay/netlink/netlink.h @@ -19,13 +19,15 @@ #include +#include + #ifndef NETLINK_AUDIT #define NETLINK_AUDIT 9 #endif namespace netlink { -class Netlink final { +class KLAY_EXPORT Netlink final { public: Netlink(int); Netlink(Netlink&&); diff --git a/include/klay/process.h b/include/klay/process.h index 9b629a2..87575ed 100644 --- a/include/klay/process.h +++ b/include/klay/process.h @@ -20,9 +20,11 @@ #include #include +#include + namespace runtime { -class Process { +class KLAY_EXPORT Process { public: typedef pid_t Pid; diff --git a/include/klay/reflection.h b/include/klay/reflection.h index acac177..eb96c48 100644 --- a/include/klay/reflection.h +++ b/include/klay/reflection.h @@ -19,6 +19,7 @@ #include +#include #include #define VISIT_ELEMENT(elem) v.visit(#elem, elem) @@ -40,7 +41,7 @@ void accept(V v) const \ static void accept(V) {} template -struct ReflectionTraitChecker { +struct KLAY_EXPORT ReflectionTraitChecker { struct Visitor {}; template static std::true_type @@ -53,6 +54,6 @@ struct ReflectionTraitChecker { }; template -struct IsReflectable : public std::integral_constant::value> {}; +struct KLAY_EXPORT IsReflectable : public std::integral_constant::value> {}; #endif //!__RUNTIME_REFLECTION_H__ diff --git a/include/klay/rmi/client.h b/include/klay/rmi/client.h index d0c81e6..2af2d31 100644 --- a/include/klay/rmi/client.h +++ b/include/klay/rmi/client.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -30,7 +31,7 @@ namespace rmi { template -class RemoteAccessClient { +class KLAY_EXPORT RemoteAccessClient { public: RemoteAccessClient(const std::string& address); virtual ~RemoteAccessClient(); @@ -176,7 +177,7 @@ Type RemoteAccessClient::methodCall(const std::string& method, A return response; } -class DefaultExceptionModel { +class KLAY_EXPORT DefaultExceptionModel { public: void raise(const std::string& target, const std::string& except); }; diff --git a/include/klay/rmi/connection.h b/include/klay/rmi/connection.h index af73a77..27a87bc 100644 --- a/include/klay/rmi/connection.h +++ b/include/klay/rmi/connection.h @@ -20,12 +20,13 @@ #include #include +#include #include #include namespace rmi { -class Connection { +class KLAY_EXPORT Connection { public: Connection(Socket&& sock); Connection(const Connection&) = delete; diff --git a/include/klay/rmi/message-composer.h b/include/klay/rmi/message-composer.h index b5279b2..41d366a 100644 --- a/include/klay/rmi/message-composer.h +++ b/include/klay/rmi/message-composer.h @@ -19,9 +19,11 @@ #include +#include + namespace rmi { -class MessageComposer { +class KLAY_EXPORT MessageComposer { public: MessageComposer(size_t caps = 4096); MessageComposer(const MessageComposer& rhs); diff --git a/include/klay/rmi/message.h b/include/klay/rmi/message.h index 7ac0208..e8afdd7 100644 --- a/include/klay/rmi/message.h +++ b/include/klay/rmi/message.h @@ -22,13 +22,14 @@ #include #include +#include #include #include #include namespace rmi { -class Message { +class KLAY_EXPORT Message { public: enum Type { Invalid, diff --git a/include/klay/rmi/notification.h b/include/klay/rmi/notification.h index adf5bf9..a48e108 100644 --- a/include/klay/rmi/notification.h +++ b/include/klay/rmi/notification.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -33,7 +34,7 @@ namespace rmi { typedef std::pair SubscriptionId; -class Notification { +class KLAY_EXPORT Notification { public: Notification(); Notification(const std::string& name); diff --git a/include/klay/rmi/service.h b/include/klay/rmi/service.h index 2cd75f0..b5158f7 100644 --- a/include/klay/rmi/service.h +++ b/include/klay/rmi/service.h @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -145,7 +146,7 @@ typedef std::function ConnectionCallback; typedef std::function PrivilegeChecker; typedef std::function AuditTrail; -class Service { +class KLAY_EXPORT Service { public: Service(const std::string& address); virtual ~Service(); diff --git a/include/klay/rmi/socket.h b/include/klay/rmi/socket.h index a222016..76b1872 100644 --- a/include/klay/rmi/socket.h +++ b/include/klay/rmi/socket.h @@ -17,23 +17,24 @@ #ifndef __RMI_SOCKET_H__ #define __RMI_SOCKET_H__ +#include #include namespace rmi { -class SocketException: public runtime::Exception { +class KLAY_EXPORT SocketException: public runtime::Exception { public: SocketException(const std::string& msg) : runtime::Exception(msg) {} }; -struct Credentials { +struct KLAY_EXPORT Credentials { pid_t pid; uid_t uid; gid_t gid; std::string security; }; -class Socket { +class KLAY_EXPORT Socket { public: explicit Socket(int socketFd = -1, bool autoclose = true); Socket(Socket&& socket) noexcept; diff --git a/include/klay/serialize.h b/include/klay/serialize.h index 461882c..0fccf1b 100644 --- a/include/klay/serialize.h +++ b/include/klay/serialize.h @@ -21,12 +21,13 @@ #include #include +#include #include namespace runtime { template -struct SerializableArgument { +struct KLAY_EXPORT SerializableArgument { SerializableArgument(const T& arg) : value(arg) { @@ -37,7 +38,7 @@ struct SerializableArgument { }; template -struct DeserializableArgument { +struct KLAY_EXPORT DeserializableArgument { DeserializableArgument(T& arg) : value(arg) { @@ -48,7 +49,7 @@ struct DeserializableArgument { }; template -class Serializer { +class KLAY_EXPORT Serializer { public: Serializer(StorageType& source) : storage(source) @@ -94,7 +95,7 @@ private: }; template -class Deserializer { +class KLAY_EXPORT Deserializer { public: Deserializer(StorageType& source) : storage(source) diff --git a/include/klay/testbench.h b/include/klay/testbench.h index 1fd6841..a31a616 100644 --- a/include/klay/testbench.h +++ b/include/klay/testbench.h @@ -14,8 +14,8 @@ * limitations under the License */ -#ifndef __DPM_TESTBENCH_H__ -#define __DPM_TESTBENCH_H__ +#ifndef __KLAY_TESTBENCH_H__ +#define __KLAY_TESTBENCH_H__ #include @@ -24,9 +24,11 @@ #include #include +#include + namespace testbench { -struct Source { +struct KLAY_EXPORT Source { Source(const std::string& file, long line, const std::string& msg); std::string fileName; @@ -34,7 +36,7 @@ struct Source { std::string message; }; -class TestResult { +class KLAY_EXPORT TestResult { public: TestResult(); virtual ~TestResult(); @@ -46,7 +48,7 @@ private: int __failureCount; }; -class TestSuite { +class KLAY_EXPORT TestSuite { public: TestSuite(const std::string& name); virtual ~TestSuite(); @@ -94,7 +96,7 @@ private: TestCaseRegistry __registry; }; -class Testbench { +class KLAY_EXPORT Testbench { public: static void addTestSuite(TestSuite *testSuite); static void runAllTestSuites(); @@ -160,4 +162,4 @@ void TestName##TestCase::standalone() return; \ } } // namespace testbench -#endif //!__DPM_TESTBENCH_H__ +#endif //!__KLAY_TESTBENCH_H__ diff --git a/include/klay/thread-pool.h b/include/klay/thread-pool.h index e00e4cf..a0da024 100644 --- a/include/klay/thread-pool.h +++ b/include/klay/thread-pool.h @@ -24,9 +24,11 @@ #include #include +#include + namespace runtime { -class ThreadPool { +class KLAY_EXPORT ThreadPool { public: ThreadPool(size_t threads); ~ThreadPool(); diff --git a/include/klay/xml/document.h b/include/klay/xml/document.h index 6704a33..ed6af71 100644 --- a/include/klay/xml/document.h +++ b/include/klay/xml/document.h @@ -22,11 +22,12 @@ #include +#include #include namespace xml { -class Document { +class KLAY_EXPORT Document { public: Document(const std::string& root, const std::string& version = XML_DEFAULT_VERSION); Document(xmlDoc* doc); diff --git a/include/klay/xml/keepblanks.h b/include/klay/xml/keepblanks.h index 7d5c2f4..13dff45 100644 --- a/include/klay/xml/keepblanks.h +++ b/include/klay/xml/keepblanks.h @@ -19,9 +19,11 @@ #include +#include + namespace xml { -class KeepBlanks { +class KLAY_EXPORT KeepBlanks { public: KeepBlanks(bool value); ~KeepBlanks(); diff --git a/include/klay/xml/node.h b/include/klay/xml/node.h index 4a0e5ae..09ece09 100644 --- a/include/klay/xml/node.h +++ b/include/klay/xml/node.h @@ -23,9 +23,11 @@ #include #include +#include + namespace xml { -class Node { +class KLAY_EXPORT Node { public: typedef std::vector NodeList; diff --git a/include/klay/xml/parser.h b/include/klay/xml/parser.h index b082386..bce6ca5 100644 --- a/include/klay/xml/parser.h +++ b/include/klay/xml/parser.h @@ -21,11 +21,12 @@ #include +#include #include namespace xml { -class Parser { +class KLAY_EXPORT Parser { public: static Document* parseFile(const std::string& filename, bool validate = false); static Document* parseString(const std::string& xml, bool validate = false);