@@ -25,7 +25,7 @@
namespace rtc {
-class Candidate {
+class RTC_CPP_EXPORT Candidate {
public:
enum class Family { Unresolved, Ipv4, Ipv6 };
enum class Type { Unknown, Host, ServerReflexive, PeerReflexive, Relayed };
@@ -28,7 +28,7 @@
-class Channel {
+class RTC_CPP_EXPORT Channel {
Channel() = default;
virtual ~Channel() = default;
@@ -26,7 +26,7 @@
-struct IceServer {
+struct RTC_CPP_EXPORT IceServer {
enum class Type { Stun, Turn };
enum class RelayType { TurnUdp, TurnTcp, TurnTls };
@@ -36,7 +36,7 @@ namespace rtc {
class SctpTransport;
class PeerConnection;
-class DataChannel : public std::enable_shared_from_this<DataChannel>, public Channel {
+class RTC_CPP_EXPORT DataChannel : public std::enable_shared_from_this<DataChannel>, public Channel {
DataChannel(std::weak_ptr<PeerConnection> pc, uint16_t stream, string label, string protocol,
Reliability reliability);
@@ -32,7 +32,7 @@
-class Description {
+class RTC_CPP_EXPORT Description {
enum class Type { Unspec, Offer, Answer, Pranswer, Rollback };
enum class Role { ActPass, Passive, Active };
@@ -28,9 +28,12 @@
#endif
#ifdef _WIN32
+#define RTC_CPP_EXPORT __declspec(dllexport)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0602 // Windows 8
+#else
+#define RTC_CPP_EXPORT
#include "log.hpp"
@@ -35,6 +35,12 @@
#pragma warning(pop)
+#ifdef _WIN32
+#endif
+
enum class LogLevel { // Don't change, it must match plog severity
@@ -47,8 +53,8 @@ enum class LogLevel { // Don't change, it must match plog severity
Verbose = 6
};
-void InitLogger(LogLevel level);
-void InitLogger(plog::Severity severity, plog::IAppender *appender = nullptr);
+RTC_CPP_EXPORT void InitLogger(LogLevel level);
+RTC_CPP_EXPORT void InitLogger(plog::Severity severity, plog::IAppender *appender = nullptr);
} // namespace rtc
@@ -57,7 +57,7 @@ struct DataChannelInit {
string protocol = "";
-class PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
+class RTC_CPP_EXPORT PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
enum class State : int {
New = RTC_NEW,
@@ -203,8 +203,8 @@ private:
-std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::State state);
-std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::GatheringState state);
-std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::SignalingState state);
+RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::State state);
+RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::GatheringState state);
+RTC_CPP_EXPORT std::ostream &operator<<(std::ostream &out, rtc::PeerConnection::SignalingState state);