diff --git a/include/rtc/description.hpp b/include/rtc/description.hpp index ddbbf09..c428cda 100644 --- a/include/rtc/description.hpp +++ b/include/rtc/description.hpp @@ -245,8 +245,8 @@ private: } // namespace rtc -std::ostream &operator<<(std::ostream &out, const rtc::Description &description); -std::ostream &operator<<(std::ostream &out, rtc::Description::Type type); -std::ostream &operator<<(std::ostream &out, rtc::Description::Role role); +RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, const rtc::Description &description); +RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::Description::Type type); +RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::Description::Role role); #endif diff --git a/include/rtc/include.hpp b/include/rtc/include.hpp index 22888c0..7dd9599 100644 --- a/include/rtc/include.hpp +++ b/include/rtc/include.hpp @@ -28,9 +28,12 @@ #endif #ifdef _WIN32 +#define RTC_CPP_EXPORT __declspec(dllexport) #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0602 // Windows 8 #endif +#else +#define RTC_CPP_EXPORT #endif #include "log.hpp" diff --git a/include/rtc/log.hpp b/include/rtc/log.hpp index 9a604b9..56a2daf 100644 --- a/include/rtc/log.hpp +++ b/include/rtc/log.hpp @@ -35,11 +35,7 @@ #pragma warning(pop) #endif -#ifdef _WIN32 -#define RTC_CPP_EXPORT __declspec(dllexport) -#else -#define RTC_CPP_EXPORT -#endif +#include "include.hpp" namespace rtc { diff --git a/src/certificate.hpp b/src/certificate.hpp index 413801b..4c19dfc 100644 --- a/src/certificate.hpp +++ b/src/certificate.hpp @@ -27,7 +27,7 @@ namespace rtc { -class RTC_CPP_EXPORT Certificate { +class Certificate { public: Certificate(string crt_pem, string key_pem); @@ -53,17 +53,17 @@ private: }; #if USE_GNUTLS -RTC_CPP_EXPORT string make_fingerprint(gnutls_x509_crt_t crt); +string make_fingerprint(gnutls_x509_crt_t crt); #else -RTC_CPP_EXPORT string make_fingerprint(X509 *x509); +string make_fingerprint(X509 *x509); #endif using certificate_ptr = std::shared_ptr; using future_certificate_ptr = std::shared_future; -RTC_CPP_EXPORT future_certificate_ptr make_certificate(string commonName = "libdatachannel"); // cached +future_certificate_ptr make_certificate(string commonName = "libdatachannel"); // cached -RTC_CPP_EXPORT void CleanupCertificateCache(); +void CleanupCertificateCache(); } // namespace rtc diff --git a/src/dtlssrtptransport.hpp b/src/dtlssrtptransport.hpp index 6b6a061..435b0a6 100644 --- a/src/dtlssrtptransport.hpp +++ b/src/dtlssrtptransport.hpp @@ -34,7 +34,7 @@ namespace rtc { -class RTC_CPP_EXPORT DtlsSrtpTransport final : public DtlsTransport { +class DtlsSrtpTransport final : public DtlsTransport { public: static void Init(); static void Cleanup(); diff --git a/src/icetransport.hpp b/src/icetransport.hpp index 9e0f053..fc5fba4 100644 --- a/src/icetransport.hpp +++ b/src/icetransport.hpp @@ -38,7 +38,7 @@ namespace rtc { -class RTC_CPP_EXPORT IceTransport : public Transport { +class IceTransport : public Transport { public: enum class GatheringState { New = 0, InProgress = 1, Complete = 2 }; diff --git a/src/processor.hpp b/src/processor.hpp index c5cfdc6..2b47c82 100644 --- a/src/processor.hpp +++ b/src/processor.hpp @@ -33,7 +33,7 @@ namespace rtc { // Processed tasks in order by delegating them to the thread pool -class RTC_CPP_EXPORT Processor final { +class Processor final { public: Processor(size_t limit = 0); ~Processor(); diff --git a/src/sctptransport.hpp b/src/sctptransport.hpp index 992325b..41d49b2 100644 --- a/src/sctptransport.hpp +++ b/src/sctptransport.hpp @@ -37,7 +37,7 @@ namespace rtc { -class RTC_CPP_EXPORT SctpTransport final : public Transport { +class SctpTransport final : public Transport { public: static void Init(); static void Cleanup(); diff --git a/src/tcptransport.hpp b/src/tcptransport.hpp index 4157bd5..1447835 100644 --- a/src/tcptransport.hpp +++ b/src/tcptransport.hpp @@ -34,7 +34,7 @@ namespace rtc { // Utility class to interrupt select() -class RTC_CPP_EXPORT SelectInterrupter { +class SelectInterrupter { public: SelectInterrupter(); ~SelectInterrupter(); @@ -51,7 +51,7 @@ private: #endif }; -class RTC_CPP_EXPORT TcpTransport : public Transport { +class TcpTransport : public Transport { public: TcpTransport(const string &hostname, const string &service, state_callback callback); ~TcpTransport(); diff --git a/src/threadpool.hpp b/src/threadpool.hpp index c93f41c..6df8cfd 100644 --- a/src/threadpool.hpp +++ b/src/threadpool.hpp @@ -37,7 +37,7 @@ namespace rtc { template using invoke_future_t = std::future, std::decay_t...>>; -class RTC_CPP_EXPORT ThreadPool final { +class ThreadPool final { public: static ThreadPool &Instance(); diff --git a/src/tlstransport.hpp b/src/tlstransport.hpp index 09db805..820d4e9 100644 --- a/src/tlstransport.hpp +++ b/src/tlstransport.hpp @@ -32,7 +32,7 @@ namespace rtc { class TcpTransport; -class RTC_CPP_EXPORT TlsTransport : public Transport { +class TlsTransport : public Transport { public: static void Init(); static void Cleanup(); diff --git a/src/transport.hpp b/src/transport.hpp index 19ac8c4..ebc68fd 100644 --- a/src/transport.hpp +++ b/src/transport.hpp @@ -30,7 +30,7 @@ namespace rtc { using namespace std::placeholders; -class RTC_CPP_EXPORT Transport { +class Transport { public: enum class State { Disconnected, Connecting, Connected, Completed, Failed }; using state_callback = std::function; diff --git a/src/verifiedtlstransport.hpp b/src/verifiedtlstransport.hpp index 08472b3..d70b1ca 100644 --- a/src/verifiedtlstransport.hpp +++ b/src/verifiedtlstransport.hpp @@ -25,7 +25,7 @@ namespace rtc { -class RTC_CPP_EXPORT VerifiedTlsTransport final : public TlsTransport { +class VerifiedTlsTransport final : public TlsTransport { public: VerifiedTlsTransport(std::shared_ptr lower, string host, state_callback callback); ~VerifiedTlsTransport(); diff --git a/src/wstransport.hpp b/src/wstransport.hpp index 35457d3..69ebed1 100644 --- a/src/wstransport.hpp +++ b/src/wstransport.hpp @@ -29,7 +29,7 @@ namespace rtc { class TcpTransport; class TlsTransport; -class RTC_CPP_EXPORT WsTransport : public Transport { +class WsTransport : public Transport { public: WsTransport(std::shared_ptr lower, string host, string path, message_callback recvCallback, state_callback stateCallback);